Activity¶
activity
¶
Activity decorator, registry, and execution context.
ActivityInfo
dataclass
¶
Metadata attached to the currently running activity attempt.
ActivityContext
¶
Per-attempt activity context exposed by :func:durable_workflow.activity.context.
is_cancelled
property
¶
True once the server has signalled that the owning workflow cancelled this activity.
heartbeat
async
¶
Report liveness to the server and check for a cancellation request.
Long-running activities should call heartbeat() periodically so the
server can distinguish a slow-but-alive attempt from a dead worker.
Optional details are attached to the heartbeat and surface as the
activity's last-known progress on failure.
Raises :class:~durable_workflow.errors.ActivityCancelled when the
owning workflow has requested cancellation, so the activity can exit
cleanly at its next natural break point.