pub struct Config<DT, ET> {
pub storage: Storage,
/* private fields */
}Fields§
§storage: StorageImplementations§
Source§impl<DT, ET> Config<DT, ET>
impl<DT, ET> Config<DT, ET>
Sourcepub fn register_queue<Q>(self) -> Selfwhere
Q: Queue,
pub fn register_queue<Q>(self) -> Selfwhere
Q: Queue,
Registers a queue by its type.
Sourcepub fn register_queue_with(&mut self, config: QueueConfig)
pub fn register_queue_with(&mut self, config: QueueConfig)
Registers a queue from a QueueConfig.
Sourcepub fn register_queue_with_concurrency<Q>(self, concurrency: usize) -> Selfwhere
Q: Queue,
pub fn register_queue_with_concurrency<Q>(self, concurrency: usize) -> Selfwhere
Q: Queue,
Registers a queue by its type with a custom concurrency limit.
Sourcepub fn register_worker<W, A>(self) -> Self
pub fn register_worker<W, A>(self) -> Self
Registers a worker and its associated job type.
Sourcepub fn register_worker_with(&mut self, config: WorkerConfig<DT, ET>)
pub fn register_worker_with(&mut self, config: WorkerConfig<DT, ET>)
Registers a worker from a WorkerConfig.
Sourcepub fn exit_when_processed(self, processed: u64) -> Self
pub fn exit_when_processed(self, processed: u64) -> Self
Stops processing after the given number of jobs have been processed. Useful for testing.
Sourcepub fn with_graceful_shutdown(
self,
fut: impl Future<Output = Result<(), Error>> + Send + Sync + 'static,
) -> Self
pub fn with_graceful_shutdown( self, fut: impl Future<Output = Result<(), Error>> + Send + Sync + 'static, ) -> Self
Sets a future that triggers graceful shutdown when it completes. Defaults to listening for SIGTERM/SIGINT on Unix and Ctrl+C on Windows.
Sourcepub fn with_retry_delay_override(
self,
f: impl Fn(&ET, u32, u64) -> Option<u64> + Send + Sync + 'static,
) -> Self
pub fn with_retry_delay_override( self, f: impl Fn(&ET, u32, u64) -> Option<u64> + Send + Sync + 'static, ) -> Self
Sets a global callback to override the retry delay when a job fails.
The callback receives (error, retry_count, default_delay) and returns
Some(seconds) to override or None to use the worker’s default.
pub fn consume_shutdown_signal( &mut self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + Sync + 'static>>
Sourcepub fn has_registered_queue<Q: Queue>(&self) -> bool
pub fn has_registered_queue<Q: Queue>(&self) -> bool
Returns true if the given queue type has been registered.
Sourcepub fn has_registered_worker(&self, name: &str) -> bool
pub fn has_registered_worker(&self, name: &str) -> bool
Returns true if a worker with the given name has been registered.
Sourcepub fn has_registered_worker_type<W: 'static>(&self) -> bool
pub fn has_registered_worker_type<W: 'static>(&self) -> bool
Returns true if a worker of the given type has been registered.
Sourcepub fn has_registered_cron_worker(&self, name: &str) -> bool
pub fn has_registered_cron_worker(&self, name: &str) -> bool
Returns true if a cron worker with the given name has been registered.
Sourcepub fn has_registered_cron_worker_type<W: 'static>(&self) -> bool
pub fn has_registered_cron_worker_type<W: 'static>(&self) -> bool
Returns true if a cron worker of the given type has been registered.