Struct prefect::RunningJobData

source ·
pub struct RunningJobData {
    pub id: Uuid,
    pub worker_id: u64,
    pub heartbeat_increment: i32,
    pub job_type: String,
    pub priority: i32,
    pub weight: u16,
    pub payload: Vec<u8>,
    pub expires: AtomicI64,
    pub start_time: OffsetDateTime,
    pub current_try: i32,
    pub max_retries: i32,
    /* private fields */
}
Expand description

Information about a running job. This is usually accessed through the RunningJob type, which wraps this in an Arc.

Fields

id: Uuid

The id of this job.

worker_id: u64

The ID of the Worker that is running this job.

heartbeat_increment: i32

How many seconds a heartbeat can extend the expiration time.

job_type: String

The type of the job.

priority: i32

The job’s priority.

weight: u16

How much this job counts against the worker’s concurrency limit.

payload: Vec<u8>

The payload of the job. JSON payloads can be parsed using the RunningJobData::json_payload function.

expires: AtomicI64

The timestamp, in seconds, when this job expires.

start_time: OffsetDateTime

When the job was started.

current_try: i32

How many times this job has been tried already. On the first run, this will be 0.

max_retries: i32

The number of times this job can be retried before giving up permanently.

Implementations

Checkpoint the task, replacing the payload with the passed in value.

Checkpoint the task, replacing the payload with the passed in value.

Tell the queue that the task is still running.

Return if the task is past the expiration time or not.

Deserialize a JSON payload into the requested type.

Mark the job as successful.

Mark the job as failed.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more