Skip to main content

SqliteTask

Type Alias SqliteTask 

Source
pub type SqliteTask<Args = Vec<u8>> = Task<Args>;
Expand description

An alias for Task specialized for Sqlite

Aliased Type§

pub struct SqliteTask<Args = Vec<u8>> {
    pub args: Args,
    /* private fields */
}

Fields§

§args: Args

The argument task part

Methods from Deref<Target = ExecutionContext>§

Source

pub fn task_id(&self) -> Option<&TaskId>

Returns the task’s ID, if one has been allocated.

Source

pub fn data(&self) -> &Extensions

Returns the extensions associated with the task.

Source

pub fn attempt(&self) -> usize

Returns the number of attempts made to execute the task.

Source

pub fn raw_attempt(&self) -> &Attempt

Get the atomic attempt

Source

pub fn status(&self) -> Status

Returns the current status of the task.

Source

pub fn raw_status(&self) -> &AtomicStatus

Get the atomic status

Source

pub fn run_at(&self) -> Option<u64>

Returns the time at which the task is scheduled to run.

Returns None if no run time has been specified.

Source

pub fn done_at(&self) -> Option<u64>

Returns the time at which the task was completed.

Returns None if the task has not been completed.

Source

pub fn lock_at(&self) -> Option<u64>

Returns the time at which the task was locked.

Returns None if the task is not locked.

Source

pub fn lock_by(&self) -> Option<&str>

Returns the identifier of the worker or process currently holding the lock on this task.

Returns None if the task is not currently locked.

Source

pub fn idempotency_key(&self) -> Option<&str>

Returns the idempotency key associated with the task.

Returns None if no idempotency key has been specified.

Source

pub fn metadata(&self) -> &MetadataStore

Returns the metadata associated with the task.

Source

pub fn max_attempts(&self) -> Option<usize>

Returns the maximum number of attempts allowed for the task.

Returns None if no maximum has been specified.

Source

pub fn priority(&self) -> Option<usize>

Returns the priority of the task.

Returns None if no priority has been specified.

Source

pub fn queue(&self) -> Option<&Queue>

Returns the queue to which the task belongs.

Returns None if the task is not associated with a queue.

Source

pub fn runs(&self) -> &[Run]

Returns the runs recorded for this task.