pub struct Task { /* private fields */ }
Expand description
Defines a worker process command.
Implementations§
Source§impl Task
impl Task
Sourcepub fn daemon(self, flag: bool) -> Self
pub fn daemon(self, flag: bool) -> Self
Set the daemon flag for the worker command.
Daemon processes are restarted if they die without being explicitly shutdown by the supervisor.
Sourcepub fn detached(self, flag: bool) -> Self
pub fn detached(self, flag: bool) -> Self
Set the detached flag for the worker command.
If a worker is detached it will not connect to the IPC socket.
Sourcepub fn retry_limit(self, limit: usize) -> Self
pub fn retry_limit(self, limit: usize) -> Self
Set the retry limit when restarting dead workers.
Only applies to tasks that have the daemon
flag set;
non-daemon tasks are not restarted. If this value is
set to zero then it overrides the daemon
flag and no
attempts to restart the process are made.
The default value is 5
.
Sourcepub fn retry_factor(self, factor: usize) -> Self
pub fn retry_factor(self, factor: usize) -> Self
Set the retry factor in milliseconds.
The default value is 0
which means retry attempts
are performed immediately.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnwindSafe for Task
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