Skip to main content

Module runtime

Module runtime 

Source
Available on crate feature tasks only.
Expand description

Centralized management of async and parallel execution.

This module provides Runtime, a cheaply cloneable handle that manages:

  • Tokio runtime (either owned or attached)
  • Task spawning with shutdown awareness and panic monitoring
  • Dedicated rayon thread pools for different workloads (with rayon feature)
  • BlockingTaskGuard for rate-limiting expensive operations (with rayon feature)

Structs§

RayonConfigrayon
Configuration for the rayon thread pools.
Runtime
A cheaply cloneable handle to the runtime resources.
RuntimeBuilder
Builder for constructing a Runtime.
RuntimeConfig
Configuration for building a Runtime.

Enums§

RuntimeBuildError
Error returned when RuntimeBuilder::build fails.
TokioConfig
Configuration for the tokio runtime.

Constants§

DEFAULT_MAX_BLOCKING_TASKS
Default maximum number of concurrent blocking tasks (for RPC tracing guard).
DEFAULT_RESERVED_CPU_CORES
Default reserved CPU cores for OS and other processes.
DEFAULT_STORAGE_POOL_THREADS
Default number of threads for the storage I/O pool.
DEFAULT_THREAD_KEEP_ALIVE
Default thread keep-alive duration for the tokio runtime.