OperationContext
Per-operation identity, deadline, and cancellation state.
Usage
OperationContext()The host supplies one context per operation. Adapters correlate request and result envelopes by operation_id and treat deadline_monotonic as the expiry point on the host’s monotonic clock (HostServices.monotonic).
Attributes
operation_id: str-
Identity of the running operation; request and result envelopes carry the same value.
dataset_id: str | None-
Host-reserved dataset correlation id, or
None. For data-producing invoke dispatches the host mints one id per operation and provides it here; a manifest published through DatasetServices.dataset_publish must use it, and a null value forbids publishing a new dataset. deadline_monotonic: float- Deadline on the host’s monotonic clock in seconds. Once HostServices.monotonic() reaches it, the operation must fail rather than transmit.
See Also
- Adapter
-
lifecycle that consumes a context per operation.
- HostServices
-
scoped services that own the monotonic clock.
Methods
| Name | Description |
|---|---|
| is_cancelled() | Report whether the host has cancelled the operation. |
| mark_dispatch_started() | Mark dispatch immediately before the adapter’s first transmit. |
is_cancelled()
Report whether the host has cancelled the operation.
Usage
is_cancelled()mark_dispatch_started()
Mark dispatch immediately before the adapter’s first transmit.
Usage
mark_dispatch_started()The host uses this marker to tell failures that never reached the device (dispatch_state: "not_dispatched") from uncertain outcomes after a transmit (dispatch_state: "unknown").