Skip to main content

callback_handler

Function callback_handler 

Source
pub async fn callback_handler<T>(
    state: &Arc<ExecutionState>,
    op_id: &OperationIdentifier,
    config: &CallbackConfig,
    logger: &Arc<dyn Logger>,
) -> Result<Callback<T>, DurableError>
Expand description

Creates a callback and returns a Callback handle.

This handler implements the callback creation semantics:

  • Generates a unique callback_id via checkpoint
  • Creates a Callback struct with result() method
  • Handles timeout and heartbeat configuration

§Arguments

  • state - The execution state for checkpointing
  • op_id - The operation identifier
  • config - Callback configuration (timeout, heartbeat)
  • logger - Logger for structured logging

§Returns

A Callback handle that can be used to wait for the result.