pub struct TaskSchedulerBuilder<'a, S: Clone> { /* private fields */ }Implementations§
Source§impl<'a, S: Clone + Send + Sync + 'static> TaskSchedulerBuilder<'a, S>
impl<'a, S: Clone + Send + Sync + 'static> TaskSchedulerBuilder<'a, S>
Sourcepub fn schedule_at(self, timestamp: Timestamp) -> Self
pub fn schedule_at(self, timestamp: Timestamp) -> Self
Schedule for a specific absolute timestamp
Sourcepub fn schedule_after(self, seconds: i64) -> Self
pub fn schedule_after(self, seconds: i64) -> Self
Schedule after a relative delay (in seconds)
Sourcepub fn depend_on(self, deps: Vec<TaskId>) -> Self
pub fn depend_on(self, deps: Vec<TaskId>) -> Self
Add task dependencies - task waits for all of these to complete
Sourcepub fn depends_on(self, dep: TaskId) -> Self
pub fn depends_on(self, dep: TaskId) -> Self
Add a single task dependency
Sourcepub fn with_retry(self, policy: RetryPolicy) -> Self
pub fn with_retry(self, policy: RetryPolicy) -> Self
Enable automatic retry with exponential backoff
Sourcepub fn cron(self, expr: impl Into<String>) -> Self
pub fn cron(self, expr: impl Into<String>) -> Self
Schedule task with cron expression
Example: .cron("0 9 * * *") for 9 AM daily
Sourcepub fn daily_at(self, hour: u8, minute: u8) -> Self
pub fn daily_at(self, hour: u8, minute: u8) -> Self
Schedule task daily at specified time
Example: .daily_at(2, 30) for 2:30 AM daily
Sourcepub fn weekly_at(self, weekday: u8, hour: u8, minute: u8) -> Self
pub fn weekly_at(self, weekday: u8, hour: u8, minute: u8) -> Self
Schedule task weekly at specified day and time
Example: .weekly_at(1, 14, 30) for Mondays at 2:30 PM
weekday: 0=Sunday, 1=Monday, …, 6=Saturday
Sourcepub fn run_on_startup(self) -> Self
pub fn run_on_startup(self) -> Self
Opt-in: if this is a cron task and a scheduled run was missed while the server was down (or this is the first time the task is being registered), run it once immediately on startup before resuming the normal cron schedule.
Sourcepub async fn at(self, ts: Timestamp) -> ClResult<TaskId>
pub async fn at(self, ts: Timestamp) -> ClResult<TaskId>
Execute the scheduled task at a specific timestamp
Sourcepub async fn after(self, seconds: i64) -> ClResult<TaskId>
pub async fn after(self, seconds: i64) -> ClResult<TaskId>
Execute the scheduled task after a delay (in seconds)
Sourcepub async fn after_task(self, dep: TaskId) -> ClResult<TaskId>
pub async fn after_task(self, dep: TaskId) -> ClResult<TaskId>
Execute the scheduled task after another task completes
Sourcepub async fn with_automatic_retry(self) -> ClResult<TaskId>
pub async fn with_automatic_retry(self) -> ClResult<TaskId>
Execute the scheduled task with automatic retry using default policy
Auto Trait Implementations§
impl<'a, S> !RefUnwindSafe for TaskSchedulerBuilder<'a, S>
impl<'a, S> !UnwindSafe for TaskSchedulerBuilder<'a, S>
impl<'a, S> Freeze for TaskSchedulerBuilder<'a, S>
impl<'a, S> Send for TaskSchedulerBuilder<'a, S>
impl<'a, S> Sync for TaskSchedulerBuilder<'a, S>
impl<'a, S> Unpin for TaskSchedulerBuilder<'a, S>
impl<'a, S> UnsafeUnpin for TaskSchedulerBuilder<'a, S>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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