pub struct Supervisor { /* private fields */ }
Expand description
Manages a set of tasks, ensuring they remain operational through restarts.
The Supervisor
spawns each task with a heartbeat mechanism to monitor liveness.
If a task stops sending heartbeats or fails, it is restarted with an exponential backoff.
User commands such as adding, restarting, or killing tasks are supported via the SupervisorHandle
.
Implementations§
Source§impl Supervisor
impl Supervisor
Sourcepub fn run(self) -> SupervisorHandle
pub fn run(self) -> SupervisorHandle
Runs the supervisor, consuming it and returning a handle for external control.
This method initiates all tasks and starts the supervision loop.
Auto Trait Implementations§
impl Freeze for Supervisor
impl !RefUnwindSafe for Supervisor
impl Send for Supervisor
impl !Sync for Supervisor
impl Unpin for Supervisor
impl !UnwindSafe for Supervisor
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