cadrumo.application.operations._supervisor_execution module¶
Execution and invocation stages for the durable operation supervisor.
- class SupervisorExecutionMixin[source]¶
Bases:
SupervisorHostOwn request binding, executor execution, and durable interaction stages.
- async submit(request, *, operation_id=None)[source]¶
Persist one validated operation request without starting execution.
- Return type:
TypeAliasType- Parameters:
self (SupervisorHost)
request (OperationRequest[TypeVar])
operation_id (OperationId | None)
- async start(operation_id)[source]¶
Admit one owned registered executor and return its running snapshot.
Every refusal before executor entry is raised here, and admission – the lease held and the running state committed – is durable before this returns. Execution and settlement continue in one supervised task;
settled()returns what it concluded, and observers follow its events through the journal meanwhile.- Return type:
- Parameters:
self (SupervisorHost)
operation_id (OperationId)
- async settled(operation_id)[source]¶
Return what one started operation concluded once its supervised task ends.
A cancelled wait leaves the operation running. When the task stopped without a commitable settlement, the journal’s state is raised inside
OperationUnsettledErrorwith the stopping error as its cause. Without a task in this process, the durable terminal state is awaited.- Return type:
- Parameters:
self (SupervisorHost)
operation_id (OperationId)
- async submit_transient_financial_operand(requirement, amount)[source]¶
Answer one running invocation’s declared operand wait with an amount.
The amount is a parameter and is never written to the journal: the broker settles it against the declaration that opened the wait and records only where custody stands.
- Return type:
TypeAliasType- Parameters:
self (SupervisorHost)
requirement (OperationTransientFinancialOperandRequirement)
amount (Decimal)
- async submit_ephemeral_secret(requirement, secret)[source]¶
Accept one exact-bound mutable secret without serializing or digesting it.
- Return type:
- Parameters:
self (SupervisorHost)
requirement (OperationSecretRequirement)
secret (bytearray)
- async await_terminal(operation_id)[source]¶
Await local commits promptly and bounded durable rechecks after detachment.
- Return type:
- Parameters:
self (SupervisorHost)
operation_id (OperationId)
- async respond(response)[source]¶
Consume one pending response and resume it when its policy permits.
- Return type:
- Parameters:
self (SupervisorHost)
response (OperationApplyResponse | OperationRejectResponse)