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 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 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 runtime
Sourcepub fn try_current() -> Option<System>
pub fn try_current() -> Option<System>
Runs a function using the system context.
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 enable_signals(&self)
pub fn enable_signals(&self)
Enable signals handling
Sourcepub fn disable_signals(&self)
pub fn disable_signals(&self)
Disable signals handling
Sourcepub fn list_arbiters<F, R>(&self, f: F) -> R
pub fn list_arbiters<F, R>(&self, 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>(f: F)
pub fn list_arbiter_pings<F>(f: F)
Retrieves a list of last pings records for each worker.
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 on a new thread and waits for it to complete.
If the returned future is dropped, the blocking task is cancelled.
Call detach to allow the task to continue running in the background.