pub struct QueueModule;Expand description
The queue module. Global; provides and exports Queue (also as the
app’s dyn Dispatcher, so mail, events, notifications and schedules
queue through it, and as the dyn JobMonitor behind
ctx.progress(..)), Operations and QueueOptions; contributes
the queue migrations (tables jobs, failed_jobs, job_batches and
operations), the OperationsController routes, the private channel
operations.{id} and the scheduled task queue.watchdog (every
minute, in apps with ScheduleModule); registers the commands
queue:work [--queue a,b] [--once] [--stop-when-empty] [--max-jobs N],
queue:failed, queue:retry <id|all>, queue:flush,
queue:batches [--limit N], queue:watchdog and
queue:prune [--hours N].
Workers run the handler of every
JobRegistration contributed by the
app’s modules (m.job::<J>()).
use navree_kernel::Navree;
use navree_queue::{QueueDriver, QueueModule, QueueOptions};
Navree::app()
.module(QueueModule::for_root(QueueOptions {
driver: QueueDriver::Memory,
..QueueOptions::default()
}))
.run()Used plainly (.module(QueueModule)) or through
from_config, it reads the queue
configuration section, so the app must include ConfigModule. The
database driver (the default) needs DatabaseModule.
Implementations§
Source§impl QueueModule
impl QueueModule
Sourcepub fn for_root(options: QueueOptions) -> impl Module
pub fn for_root(options: QueueOptions) -> impl Module
The module with explicit options (configure it once, in the app root).
Sourcepub fn from_config() -> impl Module
pub fn from_config() -> impl Module
The module configured from section queue of the app configuration.
Trait Implementations§
Source§impl Clone for QueueModule
impl Clone for QueueModule
impl Copy for QueueModule
Source§impl Debug for QueueModule
impl Debug for QueueModule
Source§impl Default for QueueModule
impl Default for QueueModule
Source§impl Module for QueueModule
impl Module for QueueModule
Source§fn register(&self, m: &mut ModuleBuilder)
fn register(&self, m: &mut ModuleBuilder)
Source§fn id(&self) -> ModuleId
fn id(&self) -> ModuleId
for_root wrappers override this to return the id
of the module type they configure.Source§fn is_configured(&self) -> bool
fn is_configured(&self) -> bool
for_root(...) values return true; at most one configured instance per id.Auto Trait Implementations§
impl Forget for QueueModule
impl Freeze for QueueModule
impl Move for QueueModule
impl RefUnwindSafe for QueueModule
impl Send for QueueModule
impl Sync for QueueModule
impl Unpin for QueueModule
impl UnsafeUnpin for QueueModule
impl UnwindSafe for QueueModule
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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