pub struct Request<T>where
T: Task,{Show 13 fields
pub app: Arc<Celery>,
pub id: String,
pub group: Option<String>,
pub chord: Option<String>,
pub correlation_id: String,
pub params: T::Params,
pub origin: Option<String>,
pub retries: u32,
pub eta: Option<DateTime<Utc>>,
pub expires: Option<DateTime<Utc>>,
pub hostname: Option<String>,
pub reply_to: Option<String>,
pub time_limit: Option<u32>,
}
Expand description
A Request
contains information and state related to the currently executing task.
Fields§
§app: Arc<Celery>
§id: String
The unique ID of the executing task.
group: Option<String>
The unique ID of the task’s group, if this task is a member.
chord: Option<String>
The unique ID of the chord this task belongs to (if the task is part of the header).
correlation_id: String
Custom ID used for things like de-duplication. Usually the same as id
.
params: T::Params
Parameters used to call this task.
origin: Option<String>
Name of the host that sent this task.
retries: u32
How many times the current task has been retried.
eta: Option<DateTime<Utc>>
The original ETA of the task.
expires: Option<DateTime<Utc>>
The original expiration time of the task.
hostname: Option<String>
Node name of the worker instance executing the task.
reply_to: Option<String>
Where to send reply to (queue name).
time_limit: Option<u32>
The time limit (in seconds) allocated for this task to execute.
Implementations§
Source§impl<T> Request<T>where
T: Task,
impl<T> Request<T>where
T: Task,
pub fn new(app: Arc<Celery>, m: Message, p: T::Params) -> Self
Sourcepub fn is_delayed(&self) -> bool
pub fn is_delayed(&self) -> bool
Check if the request has a future ETA.
Sourcepub fn countdown(&self) -> Option<Duration>
pub fn countdown(&self) -> Option<Duration>
Get the TTL in seconds if the task has a future ETA.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the request is expired.