pub struct AddJob<'a> { /* private fields */ }Expand description
Fluent builder returned by Queue::add.
AddJob implements IntoFuture, so awaiting it adds the job with the
accumulated options. Setters are infallible and chainable; any invalid
configuration (or a data serialization failure) is reported when the builder
is awaited.
Implementations§
Source§impl<'a> AddJob<'a>
impl<'a> AddJob<'a>
Sourcepub fn options(self, opts: JobOptions) -> Self
pub fn options(self, opts: JobOptions) -> Self
Use opts as the base options, replacing anything set so far.
Useful for reusing a prepared JobOptions; subsequent setters still
override individual fields.
Sourcepub fn delay(self, delay: Duration) -> Self
pub fn delay(self, delay: Duration) -> Self
Delay before the job becomes available for processing.
Sourcepub fn priority(self, priority: u32) -> Self
pub fn priority(self, priority: u32) -> Self
Job priority. Lower values are processed first; unset (or 0) means the
job is not prioritized and follows normal FIFO/LIFO ordering.
Sourcepub fn attempts(self, attempts: u32) -> Self
pub fn attempts(self, attempts: u32) -> Self
Total number of attempts before the job permanently fails.
Sourcepub fn backoff(self, backoff: BackoffStrategy) -> Self
pub fn backoff(self, backoff: BackoffStrategy) -> Self
Backoff strategy applied between retries.
Sourcepub fn job_id(self, id: impl Into<String>) -> Self
pub fn job_id(self, id: impl Into<String>) -> Self
Use a custom, unique job id instead of an auto-generated one.
Sourcepub fn remove_on_complete(self, policy: RemoveOnFinish) -> Self
pub fn remove_on_complete(self, policy: RemoveOnFinish) -> Self
Completed-job retention policy.
Sourcepub fn remove_on_fail(self, policy: RemoveOnFinish) -> Self
pub fn remove_on_fail(self, policy: RemoveOnFinish) -> Self
Failed-job retention policy.
Sourcepub fn keep_logs(self, count: u32) -> Self
pub fn keep_logs(self, count: u32) -> Self
Maximum number of log entries to retain for the job.
Sourcepub fn parent(self, parent: ParentOptions) -> Self
pub fn parent(self, parent: ParentOptions) -> Self
Attach this job to a parent job (flow / dependency chains).
Sourcepub fn deduplication(self, deduplication: DeduplicationOptions) -> Self
pub fn deduplication(self, deduplication: DeduplicationOptions) -> Self
Deduplicate the job using the given options.
Sourcepub fn size_limit(self, bytes: usize) -> Self
pub fn size_limit(self, bytes: usize) -> Self
Reject the job if its serialized payload exceeds bytes UTF-8 bytes.