pub struct FlowScheduler { /* private fields */ }Expand description
Scheduler that scans durable state and enqueues due workflow work.
Implementations§
Source§impl FlowScheduler
impl FlowScheduler
pub fn new(engine: FlowEngine, queue: Arc<dyn FlowTaskQueue>) -> Self
pub fn engine(&self) -> &FlowEngine
pub fn queue(&self) -> Arc<dyn FlowTaskQueue>
Sourcepub async fn next_wakeup(
&self,
now: DateTime<Utc>,
) -> Result<Option<WorkflowRunSuspension>>
pub async fn next_wakeup( &self, now: DateTime<Utc>, ) -> Result<Option<WorkflowRunSuspension>>
Return the earliest wait or delayed retry that can wake the scheduler.
Sourcepub async fn next_wakeup_delay(
&self,
now: DateTime<Utc>,
) -> Result<Option<Duration>>
pub async fn next_wakeup_delay( &self, now: DateTime<Utc>, ) -> Result<Option<Duration>>
Return how long the host can sleep before the next scheduled wake-up.
Due or overdue wake-ups return Duration::ZERO. Active hooks are not
represented because external callbacks are pushed into the queue by the
callback router instead of time.
pub async fn enqueue_due_work( &self, now: DateTime<Utc>, ) -> Result<FlowSchedulerTick>
Trait Implementations§
Source§impl Clone for FlowScheduler
impl Clone for FlowScheduler
Source§fn clone(&self) -> FlowScheduler
fn clone(&self) -> FlowScheduler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for FlowScheduler
impl !UnwindSafe for FlowScheduler
impl Freeze for FlowScheduler
impl Send for FlowScheduler
impl Sync for FlowScheduler
impl Unpin for FlowScheduler
impl UnsafeUnpin for FlowScheduler
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