This directory contains a collection of examples that demonstrate the use of the elfo
ecosystem.
Run cargo run --example <name>
to run specific example if not specified something other.
Describes common concepts of elfo
, also how to work with configuration, combine actors together, enable metrics, logs and dumps.
Shows how to connect distributed actor groups.
For simplicity, it uses one common binary that runs a specific service based on the CLI argument:
cargo run --example network -- alice &
cargo run --example network -- bob
Demonstrates how to attach streams to an actor's context.
Shows how to write functional tests for your actors.
Run it as cargo test --example test
.
Note that to use test utils (e.g. Proxy
) you need to enable the test-util
feature, however in the example it's already enabled.
Demonstrates how to attach other channels to an actor's context, e.g. tokio::sync::broadcast
.