Skip to main content

wait_handler

Function wait_handler 

Source
pub async fn wait_handler(
    duration: Duration,
    state: &Arc<ExecutionState>,
    op_id: &OperationIdentifier,
    logger: &Arc<dyn Logger>,
) -> Result<(), DurableError>
Expand description

Executes a wait operation that pauses execution for a specified duration.

This handler implements the wait semantics:

  • Validates that duration is at least 1 second
  • Checkpoints the wait start time
  • Checks if the wait has elapsed
  • Suspends execution if the wait has not elapsed

§Arguments

  • duration - The duration to wait
  • state - The execution state for checkpointing
  • op_id - The operation identifier
  • logger - Logger for structured logging

§Returns

Ok(()) when the wait has elapsed, or a Suspend error if still waiting.