pub struct Builder { /* private fields */ }Expand description
A setup builder for your level runtime.
See tokio::runtime::Builder for more detailed documentation.
A level runtime is a collection of tokio current-thread runtimes.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn build(&mut self) -> LevelRuntime
pub fn build(&mut self) -> LevelRuntime
Build a new level runtime
Sourcepub fn worker_threads(&mut self, threads: usize) -> &mut Self
pub fn worker_threads(&mut self, threads: usize) -> &mut Self
How many thread-local worker threads do you want?
Sourcepub fn thread_name_prefix(&mut self, name: impl Into<String>) -> &mut Self
pub fn thread_name_prefix(&mut self, name: impl Into<String>) -> &mut Self
Set a thread name prefix for level threads.
Sourcepub fn enable_all(&mut self) -> &mut Self
pub fn enable_all(&mut self) -> &mut Self
Do you want to use IO and time?
Sourcepub fn event_interval(&mut self, interval: u32) -> &mut Self
pub fn event_interval(&mut self, interval: u32) -> &mut Self
How frequently should you epoll? (Default is 61)
Sourcepub fn global_queue_interval(&mut self, interval: u32) -> &mut Self
pub fn global_queue_interval(&mut self, interval: u32) -> &mut Self
How frequently should you check for off-runtime task submission? (Default is 31)
Sourcepub fn max_io_events_per_tick(&mut self, capacity: usize) -> &mut Self
pub fn max_io_events_per_tick(&mut self, capacity: usize) -> &mut Self
How many file descriptors should you epoll at a time? (Default is 1024)
Sourcepub fn max_blocking_threads(&mut self, capacity: usize) -> &mut Self
pub fn max_blocking_threads(&mut self, capacity: usize) -> &mut Self
How many blocking threads should each local runtime be able to create? (Devault is 512)
Sourcepub fn on_thread_park(
&mut self,
f: impl Fn() + Send + Sync + 'static,
) -> &mut Self
pub fn on_thread_park( &mut self, f: impl Fn() + Send + Sync + 'static, ) -> &mut Self
Notification of thread park
Sourcepub fn on_thread_unpark(
&mut self,
f: impl Fn() + Send + Sync + 'static,
) -> &mut Self
pub fn on_thread_unpark( &mut self, f: impl Fn() + Send + Sync + 'static, ) -> &mut Self
Notification of thread unpark
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl !UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more