Struct tokio::runtime::config::Config

source ·
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

Auto Trait Implementations§

§

impl !Freeze for Config

§

impl !RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.