pub struct WorkerConfig {
pub concurrency: usize,
pub poll_interval: Duration,
pub job_timeout: Duration,
pub visibility_timeout: Option<Duration>,
pub log_execution: bool,
}Expand description
Worker configuration.
Fields§
§concurrency: usizeNumber of concurrent jobs to process
poll_interval: DurationPoll interval for checking new jobs
job_timeout: DurationTimeout for job execution
visibility_timeout: Option<Duration>How long an in-flight claim may go unresolved before the reaper assumes the worker holding it died and returns the job to its pending queue.
dequeue records a claim in the queue’s processing set; nothing else
resolves it if the worker crashes, is SIGKILLed, or its handler task
panics, so without a reaper such a job is stranded in no queue at all
and is never retried. Worker::start runs
Queue::reclaim_stale with this timeout
in the background.
Must comfortably exceed job_timeout (the default is twice it), or a
merely slow job is re-filed while still running and executes twice.
None disables reaping entirely — only appropriate when some other
process reaps the same queue.
log_execution: boolWhether to log job execution
Trait Implementations§
Source§impl Clone for WorkerConfig
impl Clone for WorkerConfig
Source§fn clone(&self) -> WorkerConfig
fn clone(&self) -> WorkerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more