pub struct TimerScheduler { /* private fields */ }Expand description
Timer-based scheduler for real-time mode.
Respects actual timestamps using tokio timers. Functions are scheduled to execute at their specified timestamps, with earlier timestamps executing first.
Implementations§
Source§impl TimerScheduler
impl TimerScheduler
Sourcepub async fn pending_count(&self) -> usize
pub async fn pending_count(&self) -> usize
Get the number of pending tasks.
Trait Implementations§
Source§impl Default for TimerScheduler
impl Default for TimerScheduler
Source§impl Scheduler for TimerScheduler
impl Scheduler for TimerScheduler
Source§fn schedule_function(
&mut self,
start_invocation: BoxedAsyncFn,
on_error: ErrorHandler,
timestamp: Option<DateTime<Utc>>,
update_checkpoint: Option<CheckpointUpdateFn>,
)
fn schedule_function( &mut self, start_invocation: BoxedAsyncFn, on_error: ErrorHandler, timestamp: Option<DateTime<Utc>>, update_checkpoint: Option<CheckpointUpdateFn>, )
Schedule a function to be executed. Read more
Source§fn has_scheduled_function(&self) -> bool
fn has_scheduled_function(&self) -> bool
Check if there are scheduled functions pending.
Source§fn flush_timers(&mut self)
fn flush_timers(&mut self)
Flush all scheduled functions without executing them.
Auto Trait Implementations§
impl Freeze for TimerScheduler
impl !RefUnwindSafe for TimerScheduler
impl Send for TimerScheduler
impl Sync for TimerScheduler
impl Unpin for TimerScheduler
impl UnsafeUnpin for TimerScheduler
impl !UnwindSafe for TimerScheduler
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
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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.