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 documentation
class JobContext: (source)
Constructor: JobContext(driver, reserved, connection, fail)
Expose the current reservation and explicit lifecycle operations.
| Method | __init__ |
Bind operational state to one job execution. |
| Method | _require |
Reject repeated transitions on a completed context. |
| Async Method | delete |
Acknowledge the job and remove its reservation. |
| Async Method | fail |
Persist a terminal error and acknowledge the reservation. |
| Async Method | release |
Release the reservation for another attempt. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | _connection |
Logical connection name. |
| Instance Variable | _driver |
Driver owning the reservation. |
| Instance Variable | _fail |
Callback persisting a terminal failure. |
| Instance Variable | _failure |
Failure retained for propagation or reporting. |
| Instance Variable | _finished |
Finished flag used by JobContext. |
| Instance Variable | _reserved |
Current fenced reservation. |
| Property | attempts |
Return the number of reservations including this execution. |
| Property | connection |
Return the logical backend connection name. |
| Property | failure |
Return an explicitly reported terminal exception. |
| Property | finished |
Report whether an explicit lifecycle operation completed. |
| Property | id |
Return the immutable job identifier. |
| Property | queue |
Return the logical queue name. |
def __init__(self, driver:
IQueueDriver, reserved: ReservedJob, connection: str, fail: FailureCallback):
(source)
¶
Bind operational state to one job execution.
| Parameters | |
driver:orionis.queues.contracts.driver.IQueueDriver | Driver owning the reservation. |
reserved:orionis.queues.entities.reserved_job.ReservedJob | Current fenced reservation. |
connection:str | Logical connection name. |
fail:orionis.queues.context.FailureCallback | Callback persisting a terminal failure. |
| Returns | |
None | Complete the documented operation without returning a value. |
Reject repeated transitions on a completed context.
| Returns | |
None | Complete the documented operation without returning a value. |
| Raises | |
orionis.queues.exceptions.QueueLeaseError | If a lifecycle operation already completed. |
Acknowledge the job and remove its reservation.
| Returns | |
None | Complete the documented operation without returning a value. |
| Raises | |
orionis.queues.exceptions.QueueLeaseError | If the reservation is no longer owned by this execution. |
Persist a terminal error and acknowledge the reservation.
| Parameters | |
exception:Exception | Original application exception. |
| Returns | |
None | Complete the documented operation without returning a value. |
| Raises | |
orionis.queues.exceptions.QueueLeaseError | If the reservation is no longer owned by this execution. |
Release the reservation for another attempt.
| Parameters | |
delay:float, optional | Nonnegative delay in seconds. |
| Returns | |
None | Complete the documented operation without returning a value. |
| Raises | |
orionis.queues.exceptions.QueueConfigurationError | If the delay is invalid. |
orionis.queues.exceptions.QueueLeaseError | If the reservation is no longer owned by this execution. |
Report whether an explicit lifecycle operation completed.
| Returns | |
bool | Whether automatic worker acknowledgement must be skipped. |