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 BoundedQueueHandler(logging.Handler): (source)
Constructor: BoundedQueueHandler(target, capacity, app)
Deliver records to an owned sink through a bounded background queue.
Notes
Reject full queues with queue.Full at every severity. Drain accepted records on close and surface background delivery failures to the caller.
| Method | __init__ |
Start a bounded background listener for an owned logging sink. |
| Method | _observe |
Observe a sink failure without replacing the retained shutdown error. |
| Method | close |
Stop admission, drain queued records, and close the owned sink. |
| Method | emit |
Enqueue a record snapshot without waiting for queue capacity. |
| Method | flush |
Wait for queued work, then flush the owned sink and surface failures. |
| Instance Variable | _listener |
Listener produced by _Listener. |
| Instance Variable | _queue |
Name of the queue receiving or storing the job. |
| Instance Variable | _stopped |
Stopped flag used by BoundedQueueHandler. |
| Instance Variable | _target |
Owned sink, closed after the queue drains. |
Self, target: logging.Handler, capacity: int, *, app: object | None = None):
(source)
¶
Start a bounded background listener for an owned logging sink.
| Parameters | |
target:logging.Handler | Target sink, closed by this handler after accepted records drain. |
capacity:int | Positive maximum number of pending records, excluding active delivery. |
app:object | None, optional | Application supplied to sink-failure observation, or None. |
| Returns | |
None | This method does not return a value. |
| Raises | |
ValueError | If capacity is not a positive integer or is a boolean. |
Observe a sink failure without replacing the retained shutdown error.
| Parameters | |
error:BaseException | Flush or cleanup error offered to the listener's failure runtime. |
phase:str | Logging operation associated with the failure. |
| Returns | |
None | This method does not return a value. |
Stop admission, drain queued records, and close the owned sink.
| Returns | |
None | This method does not return a value. |
| Raises | |
LoggingDeliveryError | If shutdown, flushing, or sink closure fails, chained from the first failure encountered during shutdown. |
Enqueue a record snapshot without waiting for queue capacity.
| Parameters | |
record:logging.LogRecord | Source record, copied with its formatted message and reporter identity. |
| Returns | |
None | This method does not return a value. |
| Raises | |
LoggingDeliveryError | If the handler is closed or background delivery has already failed. |
queue.Full | If the pending-record queue has reached its configured capacity. |
Wait for queued work, then flush the owned sink and surface failures.
| Returns | |
None | This method does not return a value. |
| Raises | |
LoggingDeliveryError | If the sink cannot flush or a background delivery has failed. |