pub struct Task {
pub name: &'static str,
pub body: TaskBody,
pub retries: u32,
pub timeout: Option<Duration>,
pub status: TaskStatus,
pub remaining_deps: AtomicUsize,
pub initial_deps: usize,
pub current_retry: AtomicU32,
}Expand description
A task in the DAG.
Fields§
§name: &'static strHuman-readable name of the task.
body: TaskBodyThe executable logic.
retries: u32Number of retries allowed.
timeout: Option<Duration>Timeout duration.
status: TaskStatusCurrent execution status.
remaining_deps: AtomicUsizeNumber of remaining dependencies before this task can run.
initial_deps: usizeInitial number of dependencies.
current_retry: AtomicU32Current number of retries attempted.
Implementations§
Source§impl Task
impl Task
Sourcepub fn new_static(name: &'static str, body: fn() -> Result<()>) -> Self
pub fn new_static(name: &'static str, body: fn() -> Result<()>) -> Self
Create a new static task.
Sourcepub fn with_retries(self, retries: u32) -> Self
pub fn with_retries(self, retries: u32) -> Self
Set the number of retries for this task.
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set a timeout for this task.
Auto Trait Implementations§
impl !Freeze for Task
impl RefUnwindSafe for Task
impl Send for Task
impl Sync for Task
impl Unpin for Task
impl UnsafeUnpin 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