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 and storage backed by the local filesystem.

Structs§

  • Handle to a spawned task.
  • Coordinates a one-time signal across many tasks.

Enums§

Traits§

  • Interface to read and write to a blob.
  • 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 to interact with storage.
  • Interface that any runtime must implement to receive messages over a network connection.

Functions§

Type Aliases§

  • A one-time broadcast that can be awaited by many tasks. It is often used for coordinating shutdown across many tasks.