pub(crate) struct Config {
pub(crate) global_queue_interval: Option<u32>,
pub(crate) event_interval: u32,
pub(crate) local_queue_capacity: usize,
pub(crate) before_park: Option<Arc<dyn Fn() + Send + Sync>>,
pub(crate) after_unpark: Option<Arc<dyn Fn() + Send + Sync>>,
pub(crate) before_spawn: Option<Arc<dyn Fn(&TaskMeta<'_>) + Send + Sync>>,
pub(crate) after_termination: Option<Arc<dyn Fn(&TaskMeta<'_>) + Send + Sync>>,
pub(crate) disable_lifo_slot: bool,
pub(crate) seed_generator: RngSeedGenerator,
pub(crate) metrics_poll_count_histogram: Option<HistogramBuilder>,
}
Fields§
§global_queue_interval: Option<u32>
How many ticks before pulling a task from the global/remote queue?
event_interval: u32
How many ticks before yielding to the driver for timer and I/O events?
local_queue_capacity: usize
How big to make each worker’s local queue
before_park: Option<Arc<dyn Fn() + Send + Sync>>
Callback for a worker parking itself
after_unpark: Option<Arc<dyn Fn() + Send + Sync>>
Callback for a worker unparking itself
before_spawn: Option<Arc<dyn Fn(&TaskMeta<'_>) + Send + Sync>>
To run before each task is spawned.
after_termination: Option<Arc<dyn Fn(&TaskMeta<'_>) + Send + Sync>>
To run after each task is terminated.
disable_lifo_slot: bool
The multi-threaded scheduler includes a per-worker LIFO slot used to store the last scheduled task. This can improve certain usage patterns, especially message passing between tasks. However, this LIFO slot is not currently stealable.
Eventually, the LIFO slot will become stealable, however as a stop-gap, this unstable option lets users disable the LIFO task.
seed_generator: RngSeedGenerator
Random number generator seed to configure runtimes to act in a deterministic way.
metrics_poll_count_histogram: Option<HistogramBuilder>
How to build poll time histograms