Module deterministic

Source
Expand description

A deterministic runtime that randomly selects tasks to run based on a seed

§Panics

If any task panics, the runtime will panic (and shutdown).

§Example

use commonware_runtime::{Spawner, Runner, deterministic::Executor};

let (executor, runtime, auditor) = Executor::default();
executor.start(async move {
    println!("Parent started");
    let result = runtime.spawn("child", async move {
        println!("Child started");
        "hello"
    });
    println!("Child result: {:?}", result.await);
    println!("Parent exited");
});
println!("Auditor state: {}", auditor.state());

Structs§

Auditor
Track the state of the runtime for determinism auditing.
Blob
Implementation of crate::Blob for the deterministic runtime.
Config
Configuration for the deterministic runtime.
Context
Implementation of crate::Spawner, crate::Clock, crate::Network, and crate::Storage for the deterministic runtime.
Executor
Deterministic runtime that randomly selects tasks to run based on a seed.
Listener
Implementation of crate::Listener for the deterministic runtime.
Runner
Implementation of crate::Runner for the deterministic runtime.
Sink
Implementation of crate::Sink for the deterministic runtime.
Stream
Implementation of crate::Stream for the deterministic runtime.

Type Aliases§

Partition
Map of names to blob contents.