pub trait OutboxDeliveryCallback: Send + Sync {
// Required methods
fn deliver_completion(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
run_id: Option<&RunId>,
result: String,
) -> Result<bool, ServerError>;
fn deliver_failure(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
run_id: Option<&RunId>,
reason: String,
) -> Result<bool, ServerError>;
}Expand description
Routes an unmatched durable-outbox completion into the live workflow.
When the outbox is ON a worker completion can arrive at the sink with no
pending oneshot (the dispatch was non-blocking fan-out, or the original
waiter was lost). Rather than dropping it, PendingActivities::complete
hands it to this callback, which resolves the workflow to its live engine
process and delivers the terminal into its mailbox. The callback is only
installed when the outbox is enabled, so flag-off the unmatched branch
stays a silent drop.
Required Methods§
Sourcefn deliver_completion(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
run_id: Option<&RunId>,
result: String,
) -> Result<bool, ServerError>
fn deliver_completion( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, run_id: Option<&RunId>, result: String, ) -> Result<bool, ServerError>
Deliver a successful completion to the live workflow.
Returns Ok(true) when delivered to a live workflow and Ok(false)
when no run is currently live (the expected stale-completion case that
recovery re-arms).
§Errors
Returns ServerError when the engine rejects the delivery.
Sourcefn deliver_failure(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
run_id: Option<&RunId>,
reason: String,
) -> Result<bool, ServerError>
fn deliver_failure( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, run_id: Option<&RunId>, reason: String, ) -> Result<bool, ServerError>
Deliver a failure to the live workflow. Same bool/error contract as
Self::deliver_completion.
§Errors
Returns ServerError when the engine rejects the delivery.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".