Skip to main content

ShouldQueue

Trait ShouldQueue 

Source
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§

Source

fn handle<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), JobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn name(&self) -> &str

Provided Methods§

Source

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.

Source

fn backoff_seconds(&self) -> Option<u64>

Seconds to wait before releasing the job for another attempt.

Source

fn timeout_seconds(&self) -> Option<u64>

Maximum seconds a single attempt may run before it is aborted. None disables the timeout.

Source

fn fail_on_timeout(&self) -> bool

Treat a timeout as a permanent failure instead of a retryable one.

Source

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".

Implementors§