diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-22 11:06:26 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2020-05-22 11:06:26 +0200 |
commit | 4cce22504359489cced92d38a0671edce498cdd6 (patch) | |
tree | 98020e1db2d7022064af45b3feda1452c16cf764 | |
parent | d583c17782977c3547da563a62e6f9f4fada15f3 (diff) | |
download | diplonat-4cce22504359489cced92d38a0671edce498cdd6.tar.gz diplonat-4cce22504359489cced92d38a0671edce498cdd6.zip |
Some guidelines
-rw-r--r-- | README.md | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -22,6 +22,15 @@ export RUST_LOG=debug 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 * We query the `/v1/catalog/node/<node>` endpoint |