Some guidelines

This commit is contained in:
Quentin 2020-05-22 11:06:26 +02:00
parent d583c17782
commit 4cce225043

View file

@ -22,6 +22,15 @@ export RUST_LOG=debug
cargo run cargo run
``` ```
## Design Guidelines
Diplonat is made of a set of Components.
Components communicate between them thanks to [tokio::sync::watch](https://docs.rs/tokio/0.2.21/tokio/sync/index.html#watch-channel) transferring copiable messages.
Each message must contain the whole state (and not a transition) as messages can be lost if a more recent message is received.
This choice has been made to limit bugs.
If you need to watch two actors and merge their content, you may use [tokio::sync::select](https://docs.rs/tokio/0.2.21/tokio/macro.select.html).
When you read a value from source 1, you must cache it to be able to merge it later when you read from source 2.
## About Consul Catalog ## About Consul Catalog
* We query the `/v1/catalog/node/<node>` endpoint * We query the `/v1/catalog/node/<node>` endpoint