pub trait ActivityCompletionSink {
// Required methods
fn complete_activity(
&self,
completion: ActivityCompletion,
) -> Result<(), ServerError>;
fn park_activity(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<(), ServerError>;
}Expand description
Engine-owned activity completion contract used by the worker endpoint.
Required Methods§
Sourcefn complete_activity(
&self,
completion: ActivityCompletion,
) -> Result<(), ServerError>
fn complete_activity( &self, completion: ActivityCompletion, ) -> Result<(), ServerError>
Feed one worker-reported result into the engine activity contract.
§Errors
Returns ServerError when the engine rejects or cannot record the completion.
Sourcefn park_activity(
&self,
workflow_id: &WorkflowId,
activity_id: &ActivityId,
) -> Result<(), ServerError>
fn park_activity( &self, workflow_id: &WorkflowId, activity_id: &ActivityId, ) -> Result<(), ServerError>
Park one in-flight dispatch for restart recovery during a graceful drain (#207): resolve the LOCAL waiter with the ephemeral parked sentinel and nothing else.
Parking is the anti-completion — it writes nothing durable, delivers
nothing to workflow code, and never crosses the SDK wire. It exists so a
drain leaves the durable log at exactly the dangling
ActivityScheduled/ActivityStarted a kill -9 would leave (the proven
re-dispatchable state) while still unblocking the blocking dispatcher
thread, so process exit is never wedged on tokio’s blocking pool. A
dispatch with no matching waiter (already resolved) is a no-op — a park
must never be routed as an outbox failure delivery.
§Errors
Returns ServerError when sink state cannot be trusted.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".