pub struct RuntimeBuilder { /* private fields */ }Expand description
Builder for Runtime.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn event_interval(&mut self, val: usize) -> &mut Self
pub fn event_interval(&mut self, val: usize) -> &mut Self
Sets the number of scheduler ticks after which the scheduler will poll for external events (timers, I/O, and so on).
A scheduler “tick” roughly corresponds to one poll invocation on a task. Values below 1 are treated as 1.
Sourcepub fn self_wake_threshold(
&mut self,
count: u32,
duration: Duration,
) -> &mut Self
pub fn self_wake_threshold( &mut self, count: u32, duration: Duration, ) -> &mut Self
Sets the self-wake streak that is reported as a possible busy loop.
A task that wakes itself on every poll, for example a loop around
wake_by_ref() or a yield, never waits for an event. The runtime logs
a warning with the task spawn location once the task wakes itself
count times in a row and the streak lasts at least duration. Each
streak is reported once. A count of 0 disables the warning and per-task
streak tracking, but preserves Runtime::self_wake_count.
By default, 10 000 self-wakes over at least 1 second.