cadrumo.application.operations.supervisor module¶
Application-owned baseline operation supervision.
- class OperationSupervisor(*, registry, authority_operation, journal, event_stream, leases, operands, owner_id, lease_token_factory, clock, lease_duration, execution_timeout=None, cleanup_timeout=None, response_authority_issuer=None, response_token_factory=<function new_response_token>, financial_operand_custody=None)[source]¶
Bases:
SupervisorExecutionMixin,SupervisorSettlementMixin,SupervisorReconciliationMixin,OperationSupervisorLeaseMixinCoordinate durable execution, interactions, recovery, and settlement.
- Parameters:
registry (OperationRegistry)
authority_operation (PinnedAuthorityOperation)
journal (OperationJournal)
event_stream (OperationEventStream)
leases (OperationLeaseRepository)
operands (OperationSecureReferenceStore | None)
owner_id (Hex64Str)
lease_token_factory (Callable[[], OperationLeaseToken])
clock (Callable[[], datetime])
lease_duration (timedelta)
execution_timeout (timedelta | None)
cleanup_timeout (timedelta | None)
response_authority_issuer (OperationResponseAuthorityIssuer | None)
response_token_factory (Callable[[], str])
financial_operand_custody (OperationFinancialOperandCustodyRepository | None)
- async shutdown()[source]¶
Wipe runtime-only secrets and stop supervising unsettled work.
Ephemeral secrets are wiped first, so no executor still holding one can read it. Each running task is then closed under its definition’s policy: a detachable operation is cancelled and left for owner recovery, any other is asked to cancel and given its cleanup window first. Each task settles its operand custody as it stops, before the operand broker is closed.
- Return type:
- async inspect(operation_id)[source]¶
Load the authoritative current snapshot for one operation.
- Return type:
- Parameters:
operation_id (OperationId)
- async observe(operation_id)[source]¶
Return the latest durable operation observation.
- Return type:
- Parameters:
operation_id (OperationId)
- async replay(operation_id, cursor, *, limit)[source]¶
Read one bounded authoritative event page after an exclusive cursor.
- Return type:
- Parameters:
operation_id (OperationId)
cursor (OperationEventCursor)
limit (OperationReplayLimit)
- async detach(operation_id)[source]¶
Release a frontend without mutating the durable operation.
- Return type:
- Parameters:
operation_id (OperationId)
- async reject(response)[source]¶
Consume a rejected REVIEW response through the shared response transition.
- Return type:
- Parameters:
response (OperationRejectResponse)