pub struct Tasks { /* private fields */ }Expand description
Registers jobs and runs a worker (and optional scheduler) as [BackgroundService]s.
Implementations§
Source§impl Tasks
impl Tasks
pub fn new(store: Arc<dyn TaskStore>) -> Self
Sourcepub fn queue(self, q: impl Into<String>) -> Self
pub fn queue(self, q: impl Into<String>) -> Self
Single queue (shorthand for Self::queues).
Sourcepub fn queues<I, S>(self, qs: I) -> Self
pub fn queues<I, S>(self, qs: I) -> Self
Claim order = priority across queues (first is highest).
pub fn lease(self, d: Duration) -> Self
pub fn poll_interval(self, d: Duration) -> Self
pub fn max_attempts(self, n: u32) -> Self
pub fn retry_base(self, d: Duration) -> Self
pub fn scheduler_tick(self, d: Duration) -> Self
pub fn job(self, job: JobDef) -> Self
pub fn exposed(self) -> Self
pub fn guard<F>(self, f: F) -> Self
Trait Implementations§
Source§impl Plugin for Tasks
impl Plugin for Tasks
Source§fn id(&self) -> &'static str
fn id(&self) -> &'static str
Stable plugin identifier used for dependency checks and
crate::App::has_plugin. Read moreSource§fn meta(&self) -> PluginMeta
fn meta(&self) -> PluginMeta
Display name, description, and declared
PluginMeta::sdk version.Auto Trait Implementations§
impl !RefUnwindSafe for Tasks
impl !UnwindSafe for Tasks
impl Freeze for Tasks
impl Send for Tasks
impl Sync for Tasks
impl Unpin for Tasks
impl UnsafeUnpin for Tasks
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
Mutably borrows from an owned value. Read more