aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2020-05-22 11:06:26 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2020-05-22 11:06:26 +0200
commit4cce22504359489cced92d38a0671edce498cdd6 (patch)
tree98020e1db2d7022064af45b3feda1452c16cf764
parentd583c17782977c3547da563a62e6f9f4fada15f3 (diff)
downloaddiplonat-4cce22504359489cced92d38a0671edce498cdd6.tar.gz
diplonat-4cce22504359489cced92d38a0671edce498cdd6.zip
Some guidelines
-rw-r--r--README.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/README.md b/README.md
index 257278d..d656e1f 100644
--- a/README.md
+++ b/README.md
@@ -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