Skip to content

cayu.external_waits

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu import ExternalEventWaits
ExternalEventWaits.__init__(*, store: SessionStore, access_policy: ExternalWaitAccessPolicy, limits: ExternalWaitLimits | None=None, redactor: SecretRedactor | None=None, projectors: Mapping[tuple[str, int], ExternalWaitProjector] | None=None) -> None
async ExternalEventWaits.reserve_correlation(request: ExternalCorrelationRequest, *, context: ExternalWaitContext) -> ExternalCorrelation
async ExternalEventWaits.register(registration: ExternalWaitRegistration, *, context: ExternalWaitContext) -> ExternalWaitSnapshot
async ExternalEventWaits.deliver(delivery: ExternalEventDelivery, *, context: ExternalWaitContext) -> ExternalDeliveryReceipt
async ExternalEventWaits.project(registration: ExternalWaitRegistration, *, context: ExternalWaitContext) -> ExternalWaitSnapshot

Freeze result input once; replay never reruns a previously committed projector.

async ExternalEventWaits.cancel(correlation: ExternalCorrelation, *, operation_key: str, context: ExternalWaitContext) -> ExternalWaitSnapshot
async ExternalEventWaits.observe(correlation: ExternalCorrelation, *, context: ExternalWaitContext) -> ExternalWaitSnapshot
async ExternalEventWaits.lookup(request: ExternalCorrelationRequest, *, context: ExternalWaitContext) -> ExternalWaitSnapshot | None
async ExternalEventWaits.inspect(correlation: ExternalCorrelation, *, context: ExternalWaitContext) -> ExternalWaitSnapshot
async ExternalEventWaits.list(*, scope: ExternalWaitScope, source: str, context: ExternalWaitContext, after: str='', limit: int=EXTERNAL_WAIT_PAGE_SIZE) -> tuple[ExternalWaitSnapshot, ...]
async ExternalEventWaits.retire_scope(scope: ExternalWaitScope, *, operation_key: str, context: ExternalWaitContext) -> ExternalWaitRetirement

Fence a terminal generation permanently; requires scope-wide authority.

The policy receives source=“*” and action=“retire”. Unresolved runtime or timer handoffs reject retirement without changing any records.

async ExternalEventWaits.prune_retired_scope(retirement: ExternalWaitRetirement, *, context: ExternalWaitContext, limit: int=EXTERNAL_WAIT_PAGE_SIZE) -> ExternalWaitPruneResult

Remove a bounded terminal page, retaining the exact retirement tombstone.

Retrying after acknowledgement loss may prune the next page. This is maintenance progress, not a replayable per-record deletion receipt.

async ExternalEventWaits.observe_page(*, scope: ExternalWaitScope, source: str, context: ExternalWaitContext, after: str='', limit: int=EXTERNAL_WAIT_PAGE_SIZE) -> tuple[ExternalWaitSnapshot, ...]

Elect due outcomes in a bounded page using the native owner clock.

Each item commits separately. Resume from the last returned correlation key; interrupted pages are safe to repeat. No worker starts implicitly.

async ExternalEventWaits.aclose(*, timeout_s: float=10.0) -> bool

Release source · Runtime guarantees · Capability guides

from cayu import ExternalWaitAccessPolicy

Bases: ABC.

ExternalWaitAccessPolicy.authorize(context: ExternalWaitContext, *, scope: ExternalWaitScope, source: str, action: ExternalWaitAction) -> bool

Return exactly True to grant this operation; perform no external effects.

Release source · Runtime guarantees · Capability guides

from cayu import ExternalWaitAction
ExternalWaitAction = Literal['reserve', 'register', 'deliver', 'read', 'cancel', 'service', 'retire', 'cleanup']

Release source · Runtime guarantees · Capability guides

from cayu import ExternalWaitContext

Principal supplied by the trusted SDK host, never decoded from a webhook.

Bases: _Value.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
principal Identifier required
ExternalWaitContext.clean_strings(value: object) -> object

Release source · Runtime guarantees · Capability guides

from cayu import ExternalWaitProjector

Bases: ABC.

ExternalWaitProjector.project(outcome: ExternalWaitOutcome) -> str

Return deterministic bounded JSON; no side effects or execution authority.

Release source · Runtime guarantees · Capability guides

from cayu import ExternalWaitSnapshot

Bases: _Value.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
correlation ExternalCorrelation required
registration ExternalWaitRegistration | None required
revision int required
outcome ExternalWaitOutcome | None required
handoff Literal['unbound', 'pending', 'settled', 'excluded'] required
pending_handoff bool required
execution_excluded bool required
retirement_requested bool required
timer_published bool required
pending_timer bool required
projection_json str | None None
ExternalWaitSnapshot.clean_strings(value: object) -> object

Release source · Runtime guarantees · Capability guides

from cayu import JsonExternalWaitProjector

Bases: ExternalWaitProjector.

JsonExternalWaitProjector.project(outcome: ExternalWaitOutcome) -> str

Release source · Runtime guarantees · Capability guides