1#![cfg_attr(any(not(feature = "full"), tokio_wasm), allow(dead_code))]
2use crate::runtime::Callback;
3use crate::util::RngSeedGenerator;
4
5pub(crate) struct Config {
6 /// How many ticks before pulling a task from the global/remote queue?
7 pub(crate) global_queue_interval: Option<u32>,
8
9 /// How many ticks before yielding to the driver for timer and I/O events?
10 pub(crate) event_interval: u32,
11
12 /// Callback for a worker parking itself
13 pub(crate) before_park: Option<Callback>,
14
15 /// Callback for a worker unparking itself
16 pub(crate) after_unpark: Option<Callback>,
17
18 /// The multi-threaded scheduler includes a per-worker LIFO slot used to
19 /// store the last scheduled task. This can improve certain usage patterns,
20 /// especially message passing between tasks. However, this LIFO slot is not
21 /// currently stealable.
22 ///
23 /// Eventually, the LIFO slot **will** become stealable, however as a
24 /// stop-gap, this unstable option lets users disable the LIFO task.
25 pub(crate) disable_lifo_slot: bool,
26
27 /// Random number generator seed to configure runtimes to act in a
28 /// deterministic way.
29 pub(crate) seed_generator: RngSeedGenerator,
30
31 /// How to build poll time histograms
32 pub(crate) metrics_poll_count_histogram: Option<crate::runtime::HistogramBuilder>,
33
34 #[cfg(tokio_unstable)]
35 /// How to respond to unhandled task panics.
36 pub(crate) unhandled_panic: crate::runtime::UnhandledPanic,
37}
38