Skip to content

Commit

Permalink
docs(examples): note about network
Browse files Browse the repository at this point in the history
  • Loading branch information
loyd committed Jul 30, 2023
1 parent 419d0c5 commit c82bcfc
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
12 changes: 11 additions & 1 deletion examples/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Elfo Examples
# elfo examples

This directory contains a collection of examples that demonstrate the use of the `elfo` ecosystem.

Expand All @@ -8,6 +8,16 @@ Run `cargo run --example <name>` to run specific example if not specified someth

Describes common concepts of `elfo`, also how to work with configuration, combine actors together, enable metrics, logs and dumps.

## network

Shows how to connect distributed actor groups.

For simplicity, it uses one common binary that runs a specific service based on the CLI argument:
```sh
cargo run --example network -- alice &
cargo run --example network -- bob
```

## stream

Demonstrates how to attach streams to an actor's context.
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/network/alice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::time::Duration;
use elfo::{prelude::*, time::Interval, topology::Outcome};
use tracing::{info, warn};

use crate::common::{AskName, Hello};
use crate::protocol::{AskName, Hello};

fn producer() -> Blueprint {
#[message]
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/network/bob.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use elfo::prelude::*;
use tracing::{info, warn};

use crate::common::{AskName, Hello};
use crate::protocol::{AskName, Hello};

fn consumer() -> Blueprint {
ActorGroup::new().exec(|mut ctx| async move {
Expand Down
2 changes: 1 addition & 1 deletion examples/examples/network/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod alice;
mod bob;
mod common;
mod protocol;

#[tokio::main]
async fn main() {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/examples/usage/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ mod producer {
// aggregator
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// A more actor group that has sharding.
// Another actor group with sharding.
mod aggregator {
use elfo::{
prelude::*,
Expand Down

0 comments on commit c82bcfc

Please sign in to comment.