pub struct ManagedThreadService { /* private fields */ }Expand description
Managed adapter for one cooperatively cancellable thread.
Implementations§
Source§impl ManagedThreadService
impl ManagedThreadService
Sourcepub fn new<F>(descriptor: ServiceDescriptor, factory: F) -> Self
pub fn new<F>(descriptor: ServiceDescriptor, factory: F) -> Self
Creates a managed thread from a restartable factory.
Sourcepub fn with_health_probe<H>(self, health_probe: H) -> Self
pub fn with_health_probe<H>(self, health_probe: H) -> Self
Adds a live health probe evaluated while the thread is running.
Trait Implementations§
Source§impl ManagedService for ManagedThreadService
impl ManagedService for ManagedThreadService
Source§fn descriptor(&self) -> &ServiceDescriptor
fn descriptor(&self) -> &ServiceDescriptor
Returns immutable identity, dependencies, resource, and policy.
Source§fn start(&self) -> SupervisorResult<()>
fn start(&self) -> SupervisorResult<()>
Starts the service and its bounded resources.
Source§fn stop(&self, timeout: Duration) -> SupervisorResult<()>
fn stop(&self, timeout: Duration) -> SupervisorResult<()>
Requests cooperative shutdown inside
timeout.Source§fn health(&self) -> ServiceHealth
fn health(&self) -> ServiceHealth
Returns current service health.
Source§fn runtime_state(&self) -> ServiceRuntimeState
fn runtime_state(&self) -> ServiceRuntimeState
Returns the concrete service execution state.
Auto Trait Implementations§
impl !Freeze for ManagedThreadService
impl !RefUnwindSafe for ManagedThreadService
impl !UnwindSafe for ManagedThreadService
impl Send for ManagedThreadService
impl Sync for ManagedThreadService
impl Unpin for ManagedThreadService
impl UnsafeUnpin for ManagedThreadService
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