apalis_core/task/runs.rs
1//! Represents a single execution attempt of a task.
2//!
3//! It includes information about the attempt number, the serialized value of the run, timestamps for when the task was locked and completed, and the identifier of the worker that executed the task.
4
5use crate::backend::TaskResult;
6
7/// Represents a run of a task
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9#[derive(Debug, Clone)]
10pub struct Run<T = Vec<u8>> {
11 /// The serialized result of the run
12 pub result: Option<TaskResult<T>>,
13 /// The time at which the task was locked for execution
14 pub lock_at: i64,
15 /// The identifier of the worker that locked the task
16 pub lock_by: String,
17 /// The time at which the run was completed
18 pub done_at: Option<i64>,
19}