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