pub trait ShouldQueue:
Send
+ Sync
+ Debug {
// Required methods
fn handle<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn name(&self) -> &str;
// Provided methods
fn max_attempts(&self) -> Option<u64> { ... }
fn backoff_seconds(&self) -> Option<u64> { ... }
fn timeout_seconds(&self) -> Option<u64> { ... }
fn fail_on_timeout(&self) -> bool { ... }
fn delay_seconds(&self) -> Option<u64> { ... }
}Required Methods§
fn handle<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn name(&self) -> &str
Provided Methods§
Sourcefn max_attempts(&self) -> Option<u64>
fn max_attempts(&self) -> Option<u64>
Maximum attempts before the job is considered permanently failed.
None falls back to the worker default of 3 attempts.
Sourcefn backoff_seconds(&self) -> Option<u64>
fn backoff_seconds(&self) -> Option<u64>
Seconds to wait before releasing the job for another attempt.
Sourcefn timeout_seconds(&self) -> Option<u64>
fn timeout_seconds(&self) -> Option<u64>
Maximum seconds a single attempt may run before it is aborted.
None disables the timeout.
Sourcefn fail_on_timeout(&self) -> bool
fn fail_on_timeout(&self) -> bool
Treat a timeout as a permanent failure instead of a retryable one.
Sourcefn delay_seconds(&self) -> Option<u64>
fn delay_seconds(&self) -> Option<u64>
Seconds to wait before the job becomes available, mirroring Laravel’s
#[Delay] attribute. None (the default) dispatches immediately.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".