commonware_runtime/tokio/
mod.rs

1//! A production-focused runtime based on [Tokio](https://tokio.rs) with
2//! secure randomness and storage backed by the local filesystem.
3//!
4//! # Panics
5//!
6//! By default, the runtime will catch any panic and log the error. It is
7//! possible to override this behavior in the configuration.
8//!
9//! # Example
10//!
11//! ```rust
12//! use commonware_runtime::{Spawner, Runner, tokio, Metrics};
13//!
14//! let executor = tokio::Runner::default();
15//! executor.start(|context| async move {
16//!     println!("Parent started");
17//!     let result = context.with_label("child").spawn(|_| async move {
18//!         println!("Child started");
19//!         "hello"
20//!     });
21//!     println!("Child result: {:?}", result.await);
22//!     println!("Parent exited");
23//! });
24//! ```
25
26mod runtime;
27pub use runtime::*;
28pub mod telemetry;
29pub mod tracing;