pub struct TaskEvent {Show 17 fields
pub base: EventMessage,
pub uuid: Uuid,
pub name: Option<String>,
pub args: Option<String>,
pub kwargs: Option<String>,
pub retries: Option<u32>,
pub eta: Option<String>,
pub expires: Option<String>,
pub parent_id: Option<Uuid>,
pub root_id: Option<Uuid>,
pub result: Option<Value>,
pub exception: Option<String>,
pub traceback: Option<String>,
pub runtime: Option<f64>,
pub queue: Option<String>,
pub exchange: Option<String>,
pub routing_key: Option<String>,
}Expand description
Task-specific event data
Fields§
§base: EventMessageBase event
uuid: UuidTask ID (UUID)
name: Option<String>Task name
args: Option<String>Task arguments (as JSON string)
kwargs: Option<String>Task keyword arguments (as JSON string)
retries: Option<u32>Retry count
eta: Option<String>ETA for delayed tasks
expires: Option<String>Task expiration
parent_id: Option<Uuid>Parent task ID
root_id: Option<Uuid>Root task ID
result: Option<Value>Result (for task-succeeded)
exception: Option<String>Exception type (for task-failed)
traceback: Option<String>Traceback (for task-failed)
runtime: Option<f64>Runtime in seconds (for task-succeeded)
queue: Option<String>Queue name
exchange: Option<String>Exchange name
routing_key: Option<String>Routing key
Implementations§
Source§impl TaskEvent
impl TaskEvent
Sourcepub fn succeeded(task_id: Uuid, result: Value, runtime: f64) -> Self
pub fn succeeded(task_id: Uuid, result: Value, runtime: f64) -> Self
Create a task-succeeded event
Sourcepub fn failed(task_id: Uuid, exception: &str, traceback: Option<&str>) -> Self
pub fn failed(task_id: Uuid, exception: &str, traceback: Option<&str>) -> Self
Create a task-failed event
Sourcepub fn retried(task_id: Uuid, exception: &str, retries: u32) -> Self
pub fn retried(task_id: Uuid, exception: &str, retries: u32) -> Self
Create a task-retried event
Sourcepub fn revoked(task_id: Uuid, terminated: bool, signum: Option<i32>) -> Self
pub fn revoked(task_id: Uuid, terminated: bool, signum: Option<i32>) -> Self
Create a task-revoked event
Sourcepub fn with_kwargs(self, kwargs: impl Into<String>) -> Self
pub fn with_kwargs(self, kwargs: impl Into<String>) -> Self
Set task kwargs
Sourcepub fn with_hostname(self, hostname: impl Into<String>) -> Self
pub fn with_hostname(self, hostname: impl Into<String>) -> Self
Set hostname
Sourcepub fn with_queue(self, queue: impl Into<String>) -> Self
pub fn with_queue(self, queue: impl Into<String>) -> Self
Set queue
Sourcepub fn with_parent(self, parent_id: Uuid) -> Self
pub fn with_parent(self, parent_id: Uuid) -> Self
Set parent task ID
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskEvent
impl<'de> Deserialize<'de> for TaskEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for TaskEvent
Auto Trait Implementations§
impl Freeze for TaskEvent
impl RefUnwindSafe for TaskEvent
impl Send for TaskEvent
impl Sync for TaskEvent
impl Unpin for TaskEvent
impl UnwindSafe for TaskEvent
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