THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class FailureHandling: (source)
Own logging and optional presentation for one observed incident.
The runtime completes logging after the application hook returns. The protocol owner may then request presentation with its live request. Keep this object local to the operation; immutable receipts contain only status.
| Async Method | complete |
Execute the deferred logging action at most once. |
| Async Method | present |
Execute deferred presentation at most once and cache its result. |
| Class Variable | _completion |
Retained logging failure preventing automatic effect retries. |
| Class Variable | _completion |
Coordinate consumers of the single logging effect. |
| Class Variable | _completion |
Original logging traceback, without frames added by subsequent callers. |
| Class Variable | _presentation |
Whether the coordinator already emitted the presentation diagnostic. |
| Class Variable | _presentation |
Retained presentation failure preventing automatic effect retries. |
| Class Variable | _presentation |
Coordinate consumers of the single presentation effect. |
| Class Variable | _presentation |
Original presentation traceback, restored for repeated failed requests. |
| Class Variable | degraded |
Whether an effect required fallback or failed during handling. |
| Class Variable | logging |
Deferred asynchronous logging action owned by the coordinator. |
| Class Variable | presentation |
Deferred presentation accepting the owner's flow and live request. |
| Instance Variable | _completed |
Whether logging execution has already been claimed. |
| Instance Variable | _completion |
Task executing logging, cleared when the action finishes or fails. |
| Instance Variable | _presentation |
Task executing presentation, cleared when the action finishes or fails. |
| Instance Variable | _presented |
Whether presentation execution has already been claimed. |
| Instance Variable | _result |
Cached presentation outcome shared with concurrent consumers. |
| Instance Variable | reported |
Whether the logging action completed successfully. |
Execute the deferred logging action at most once.
Serialize concurrent calls and preserve failures for later callers. Restore the original traceback before re-raising a retained error so repeated callers do not accumulate one another's stack frames. Set reported after successful logging; skip logging if no action is configured or a previous call completed successfully.
| Returns | |
None | No return value. |
| Raises | |
RuntimeError | If the logging action recursively waits for its own completion. |
BaseException | If execution is cancelled, logging fails, or a retained failure is re-raised. |
Execute deferred presentation at most once and cache its result.
Serialize concurrent calls and preserve failures for later callers. Retained errors keep their identity, cause, and original traceback without accumulating the frames of previous consumers.
| Parameters | |
flow:str | Execution flow passed to the presentation callback. |
request:object or None, optional | Live request or execution state passed to the callback, when available. |
| Returns | |
object | Cached presentation result, or None if no callback is configured. |
| Raises | |
RuntimeError | If presentation recursively waits for its own result. |
BaseException | If execution is cancelled, presentation fails, or a retained failure is re-raised. |