cayu.deadlines
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.
current_execution_deadline
Section titled “current_execution_deadline”from cayu import current_execution_deadlinecurrent_execution_deadline() -> ExecutionDeadlineRelease source · Runtime guarantees · Capability guides
execution_deadline_scope
Section titled “execution_deadline_scope”from cayu import execution_deadline_scopeBind/inherit a boundary and enforce it through ordinary task cancellation.
Exit runs after enclosed cancellation settlement. Cleanup must not call require_admission: it has its own existing bounded settlement budgets.
async execution_deadline_scope(deadline: ExecutionDeadline) -> AsyncIterator[asyncio.Timeout]Release source · Runtime guarantees · Capability guides
ExecutionDeadline
Section titled “ExecutionDeadline”from cayu import ExecutionDeadlinePortable UTC expiry with a live, process-local monotonic upper bound.
None is explicit absence of a deadline. Only UTC/source/scope are serialized; loading a durable value recomputes remaining time, never its original duration.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”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 |
|---|---|---|
expires_at |
datetime | None |
None |
source |
str |
'runtime' |
scope |
str |
'execution' |
validate_expiry (method)
Section titled “validate_expiry (method)”ExecutionDeadline.validate_expiry(value: datetime | None) -> datetime | Nonevalidate_label (method)
Section titled “validate_label (method)”ExecutionDeadline.validate_label(value: str) -> strmodel_post_init (method)
Section titled “model_post_init (method)”ExecutionDeadline.model_post_init(context: Any) -> Noneafter (method)
Section titled “after (method)”ExecutionDeadline.after(seconds: float | None, *, source: str='runtime', scope: str='execution') -> ExecutionDeadlineremaining_seconds (method)
Section titled “remaining_seconds (method)”ExecutionDeadline.remaining_seconds() -> float | Noneexpired (property)
Section titled “expired (property)”ExecutionDeadline.expired() -> boolrequire_admission (method)
Section titled “require_admission (method)”ExecutionDeadline.require_admission(stage: str) -> Noneinspection (method)
Section titled “inspection (method)”ExecutionDeadline.inspection() -> dict[str, Any]Safe point-in-time evidence; call again for live remaining time.
model_context (method)
Section titled “model_context (method)”ExecutionDeadline.model_context() -> strExplicit opt-in text for a freshly built model request, not a live clock.
Release source · Runtime guarantees · Capability guides
ExecutionDeadlineExceeded
Section titled “ExecutionDeadlineExceeded”from cayu import ExecutionDeadlineExceededNew application work was denied; this does not attest external settlement.
Bases: TimeoutError.
init (method)
Section titled “init (method)”ExecutionDeadlineExceeded.__init__(deadline: ExecutionDeadline, stage: str) -> None