Nodes and Workers
Ockam Nodes and Workers decouple applications from the host environment and enable simple interfaces for stateful, asynchronous, and bi-directional message-based protocols.
Nodes
// examples/01-node.rs
// This program creates and then immediately stops a node.
use ockam::{node, Context, Result};
/// Create and then immediately stop a node.
#[ockam::node]
async fn main(ctx: Context) -> Result<()> {
// Create a node.
let mut node = node(ctx).await?;
// Stop the node as soon as it starts.
node.shutdown().await
}
Workers
Echoer worker
App worker
Message Flow

Last updated
Was this helpful?
