pub struct RuntimeBuilder { /* private fields */ }Expand description
Builder for Runtime.
Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a builder with the default scheduler budgets and warning thresholds.
Sourcepub fn event_interval(&mut self, val: usize) -> &mut Self
pub fn event_interval(&mut self, val: usize) -> &mut Self
Sets the local task-poll budget for one Runtime::poll call.
The driver can process external events between calls. Remote work is serviced in separate batches, so this is not a strict limit on all work done in one call. The default is 61; zero is treated as one.
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.