pub struct RedisJob<'a> {
    pub id: u64,
    pub key: String,
    /* private fields */
}
Expand description

Convenient wrapper struct for combing a job ID plus a connection.

Fields

id: u64key: String

Implementations

Create a new RedisJob with given ID and given connection. This ID may or may not exist.

Get a populated JobMeta from given connection by getting data for a given hash key and fields.

Get subset of metadata needed to check whether this job has timed out or not.

Get this job’s ID.

Get this job’s Redis key.

Create a Redis key for a job from a job ID.

Update this job’s status and/or output from a given request.

Add commands to a pipeline to mark this job as completed.

Note: caller is responsible for ensuring job exists and status change is valid before this is called.

Add commands to pipeline to re-queue this job so that it can be retried later.

If incr_retries is true, then increment the count of retry attempts for this job. This will typically be done for automatic retries, but not for manually requested retries.

Add commands to pipeline to re-queue this job so that it can be retried later.

Add commands to pipeline to mark this job as failed or timed out.

Note: caller is responsible for ensuring job exists and status change is valid before this is called.

Move this job to the ended queue if it’s failed or timed out.

Get some or all fields of this job’s metadata.

If None is given, then all fields are fetched.

Get queue this job was created in. This queue may or may not exist.

Get this job’s output field.

Update this job’s output field in a transaction.

Add commands to update this job’s output to a pipeline.

Get this job’s status field.

Update this job’s status field in a transaction.

Add commands to update this job’s status to a pipeline.

Checks the validity of status transitions.

Updates a job’s last heartbeat date/time.

Expires a job in a transaction.

Callers should typically check for job expiry outside of a transaction (and probably in a pipeline), then only call this on jobs to expire (since transaction here is much more expensive).

Times out a job in a transaction.

Callers should typically check for job timeout outside of a transaction (and probably in a pipeline), then only call this on jobs to timeout (since transaction here is much more expensive).

Retries out a job in a transaction.

Callers should typically check for job retries outside of a transaction (and probably in a pipeline), then only call this on jobs to retry (since transaction here is much more expensive).

Deletes this job from the server in a transaction.

Returns

Returns true if this job was deleted, false if the job wasn’t found.

Add commands to delete this job status to a pipeline.

Trait Implementations

This converts the value into a vector of bytes. Each item is a single argument. Most items generate a vector of a single item. Read more
This writes the value into a vector of bytes. Each item is a single argument. Most items generate a single item. Read more
Returns an information about the contained value with regards to it’s numeric behavior in a redis context. This is used in some high level concepts to switch between different implementations of redis functions (for instance INCR vs INCRBYFLOAT). Read more
Returns an indiciation if the value contained is exactly one argument. It returns false if it’s zero or more than one. This is used in some high level functions to intelligently switch between GET and MGET variants. 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.

Calls U::from(self).

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

Should always be Self
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.