Skip to main content

complete_external

Function complete_external 

Source
pub async fn complete_external<'e, E>(
    executor: E,
    callback_id: Uuid,
    payload: Option<Value>,
    run_lease: Option<i64>,
) -> Result<JobRow, AwaError>
where E: PgExecutor<'e>,
Expand description

Complete a waiting job via external callback.

Accepts jobs in waiting_external or running state (race handling: the external system may fire before the executor transitions to waiting_external).

When resume is false (default), the job transitions to completed. When resume is true, the job transitions back to running with the callback payload stored in metadata under _awa_callback_result. The handler can then read the result and continue processing (sequential callback pattern from ADR-016).