pub struct System { /* private fields */ }Expand description
System is a runtime manager.
Implementations§
Source§impl System
impl System
Sourcepub fn build() -> Builder
pub fn build() -> Builder
Build a new system with a customized tokio runtime.
This allows to customize the runtime. See struct level docs on
Builder for more information.
Sourcepub fn new<R: Runner>(name: &str, runner: R) -> SystemRunner
pub fn new<R: Runner>(name: &str, runner: R) -> SystemRunner
Create new system.
This method panics if it can not create tokio runtime
Sourcepub fn with_config(name: &str, config: SystemConfig) -> SystemRunner
pub fn with_config(name: &str, config: SystemConfig) -> SystemRunner
Create new system.
This method panics if it can not create tokio runtime
Sourcepub fn stop_with_code(&self, code: i32)
pub fn stop_with_code(&self, code: i32)
Stop the system with a particular exit code.
Sourcepub fn stop_on_panic(&self) -> bool
pub fn stop_on_panic(&self) -> bool
Return status of ‘stop_on_panic’ option which controls whether the System is stopped when an uncaught panic is thrown from a worker thread.
Sourcepub fn list_arbiters<F, R>(f: F) -> R
pub fn list_arbiters<F, R>(f: F) -> R
Retrieves a list of all arbiters in the system.
This method should be called from the thread where the system has been initialized, typically the “main” thread.
Sourcepub fn list_arbiter_pings<F, R>(id: Id, f: F) -> R
pub fn list_arbiter_pings<F, R>(id: Id, f: F) -> R
Retrieves a list of last pings records for specified arbiter.
This method should be called from the thread where the system has been initialized, typically the “main” thread.
Sourcepub fn spawn_blocking<F, R>(&self, f: F) -> BlockingResult<R> ⓘ
pub fn spawn_blocking<F, R>(&self, f: F) -> BlockingResult<R> ⓘ
Spawns a blocking task in a new thread, and wait for it.
The task will not be cancelled even if the future is dropped.