pub struct ChildTask {
pub id: String,
pub env_var: &'static str,
pub work: ChildWorkFn,
}Expand description
Represents a background task that can be launched by the ProcessManager.
A task is triggered by an environment variable (e.g. MY_TASK=1) and runs
the associated function inside a forked background process.
Each task instance is uniquely identified by id, which is used when hashing
the directory name for logs/PID files.
Fields§
§id: String§THIS IS DYNAMIC could change to whatever is identifying for you used for hashing
env_var: &'static strthe env var to check for in ProcessManager::check()
work: ChildWorkFnthe handler for this ChildTask
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChildTask
impl RefUnwindSafe for ChildTask
impl Send for ChildTask
impl Sync for ChildTask
impl Unpin for ChildTask
impl UnwindSafe for ChildTask
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