Crate commonware_runtime

source
Expand description

Execute asynchronous tasks with a configurable scheduler.

This crate provides a collection of runtimes that can be used to execute asynchronous tasks in a variety of ways. For production use, the tokio module provides a runtime backed by Tokio. For testing and simulation, the deterministic module provides a runtime that allows for deterministic execution of tasks (given a fixed seed).

§Status

commonware-runtime is ALPHA software and is not yet recommended for production use. Developers should expect breaking changes and occasional instability.

Modules§

  • A deterministic runtime that randomly selects tasks to run based on a seed
  • Mock implementations of commonware-runtime traits for focused, upstream testing.
  • A production-focused runtime based on Tokio with secure randomness.

Macros§

  • Macro to select the first future that completes (biased by order).

Structs§

  • Handle to a spawned task.

Enums§

Traits§

  • Interface that any task scheduler must implement to provide time-based operations.
  • Interface that any runtime must implement to handle incoming network connections.
  • Interface that any runtime must implement to create network connections.
  • Interface that any task scheduler must implement to start running tasks.
  • Interface that any runtime must implement to send messages over a network connection.
  • Interface that any task scheduler must implement to spawn sub-tasks in a given root task.
  • Interface that any runtime must implement to receive messages over a network connection.

Functions§