pub struct QueueOptions {
pub driver: QueueDriver,
pub default_queue: String,
pub workers: usize,
pub poll_interval_ms: u64,
pub queues: Vec<String>,
pub operations: OperationsOptions,
}Expand description
QueueModule settings: configuration section queue.
[queue]
driver = "database" # or "memory", "redis", or a store a module registers
default_queue = "default" # where jobs with an empty queue name go
workers = 4 # concurrent jobs per `queue:work` process
poll_interval_ms = 1000 # how long an idle worker waits before polling again
queues = ["high", "default"] # what `queue:work` processes, in priority orderEvery field has a default, so a missing section is valid.
queues may also be one comma-separated string
(APP_QUEUE__QUEUES=high,default); when empty, workers process
default_queue.
Fields§
§driver: QueueDriverWhere jobs are stored (default QueueDriver::Database).
default_queue: StringThe queue of jobs dispatched with an empty queue name, and the queue
workers process when queues is empty
(default default, the queue JobOptions
names by default).
workers: usizeHow many jobs one Queue::work call runs at
the same time (default 4).
poll_interval_ms: u64How long an idle worker waits before polling again, in milliseconds (default 1000).
queues: Vec<String>The queues workers process, highest priority first (default: just
default_queue).
operations: OperationsOptionsOperations: their routes, heartbeat and watchdog (section
queue.operations).
Implementations§
Source§impl QueueOptions
impl QueueOptions
Sourcepub fn worker_queues(&self) -> Vec<String>
pub fn worker_queues(&self) -> Vec<String>
The queues workers process when none are given: queues,
or just default_queue.
Sourcepub fn poll_interval(&self) -> Duration
pub fn poll_interval(&self) -> Duration
poll_interval_ms as a Duration.
Trait Implementations§
Source§impl Clone for QueueOptions
impl Clone for QueueOptions
Source§impl ConfigSection for QueueOptions
impl ConfigSection for QueueOptions
Source§const KEY: &'static str = "queue"
const KEY: &'static str = "queue"
"billing",
"mail.smtp").Source§fn validate(&self) -> Result<(), String>
fn validate(&self) -> Result<(), String>
KEY. The message must not echo secret values.Source§fn defaults() -> Option<Value>
fn defaults() -> Option<Value>
config:show --defaults. Leave out credentials: None (the default)
publishes nothing. defaults_of builds it from Default and
Serialize for a section that has no secret field.Source§fn schema() -> Option<SectionSchema>
fn schema() -> Option<SectionSchema>
None (the default) for a
section written by hand; #[derive(ConfigSection)] fills it in.Source§impl ConfigTable for QueueOptions
impl ConfigTable for QueueOptions
Source§impl Debug for QueueOptions
impl Debug for QueueOptions
Source§impl Default for QueueOptions
impl Default for QueueOptions
Source§impl<'de> Deserialize<'de> for QueueOptionswhere
QueueOptions: Default,
impl<'de> Deserialize<'de> for QueueOptionswhere
QueueOptions: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for QueueOptions
Source§impl PartialEq for QueueOptions
impl PartialEq for QueueOptions
Source§impl Serialize for QueueOptions
impl Serialize for QueueOptions
impl StructuralPartialEq for QueueOptions
Auto Trait Implementations§
impl Forget for QueueOptions
impl Freeze for QueueOptions
impl Move for QueueOptions
impl RefUnwindSafe for QueueOptions
impl Send for QueueOptions
impl Sync for QueueOptions
impl Unpin for QueueOptions
impl UnsafeUnpin for QueueOptions
impl UnwindSafe for QueueOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<P> ClientModuleOptions for Pwhere
P: ConfigSection + Clone,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more