Struct kaspa_core::task::runtime::AsyncRuntime
source · pub struct AsyncRuntime { /* private fields */ }Expand description
AsyncRuntime registers async services and provides a tokio Runtime to run them.
Implementations§
source§impl AsyncRuntime
impl AsyncRuntime
pub fn new(threads: usize) -> Self
pub fn register<T>(&self, service: Arc<T>)where T: AsyncService,
pub fn init( self: Arc<AsyncRuntime>, core: Arc<Core> ) -> Vec<ThreadJoinHandle<()>>
sourcepub fn worker(self: &Arc<AsyncRuntime>, core: Arc<Core>)
pub fn worker(self: &Arc<AsyncRuntime>, core: Arc<Core>)
Launch a tokio Runtime and run the top-level async objects
pub async fn worker_impl(self: &Arc<AsyncRuntime>, core: Arc<Core>)
pub fn signal_exit(self: Arc<AsyncRuntime>)
Trait Implementations§
source§impl Default for AsyncRuntime
impl Default for AsyncRuntime
source§impl Service for AsyncRuntime
impl Service for AsyncRuntime
Auto Trait Implementations§
impl RefUnwindSafe for AsyncRuntime
impl Send for AsyncRuntime
impl Sync for AsyncRuntime
impl Unpin for AsyncRuntime
impl UnwindSafe for AsyncRuntime
Blanket Implementations§
source§impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
impl<S> CastArc for Swhere S: CastFromSync + ?Sized,
source§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere T: Any + 'static,
source§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any, which is backed by the type implementing this trait.source§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any, which is backed by the type implementing this trait.