ORIONIS API REFERENCE

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

Resolve lazy connections and expose the canonical deferred dispatch API.

Method __init__ Validate and serialize queue settings without opening backend clients.
Async Method _closeOwned Detach initialized resources and attempt every owned cleanup.
Method _connectionName Validate selection against the configured named backends.
Async Method _createDriver Construct a configured driver through framework database services.
Async Method _submit Serialize validated job options and submit to the selected backend.
Async Method boot Register jobs from the application's configured jobs path.
Async Method close Release queue-owned resources without closing shared database services.
Async Method connection Resolve one shared lazy driver for the selected named connection.
Method dispatch Create one awaitable dispatch without serializing or persisting data.
Async Method failed Resolve durable failed-job storage only when first requested.
Async Method migrate Create every configured database queue table and failed-job storage.
Async Method retryFailed Requeue preserved job data with attempts reset by a fresh push.
Async Method worker Create an independent persistent worker using validated defaults.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _app Existing application container.
Instance Variable _config Validated configuration used to construct and operate the service.
Instance Variable _driver_lock Synchronization primitive controlling access to driver lock.
Instance Variable _driver_owner Task currently initializing a driver under its publication lock.
Instance Variable _drivers Configured backend drivers cached by their registered names.
Instance Variable _failed Backend retaining failed-job records.
Instance Variable _failed_lock Synchronization primitive controlling access to failed lock.
Instance Variable _failed_owner Task currently initializing the failed-job repository.
Instance Variable _serializer Singleton registered-job serializer.
def __init__(self, app: IApplication, serializer: IJobSerializer): (source)

Validate and serialize queue settings without opening backend clients.

Parameters
app:orionis.IApplicationExisting application container.
serializer:orionis.queues.contracts.serializer.IJobSerializerSingleton registered-job serializer.
Returns
NoneRetain the normalized wire settings for lazy backend resolution.
Raises
TypeErrorIf queue settings have invalid types or unsupported fields.
ValueErrorIf queue settings or their storage relationships are invalid.
async def _closeOwned(self): (source)

Detach initialized resources and attempt every owned cleanup.

Returns
NoneNo return value.
Raises
BaseExceptionCancellation in preference to ordinary errors, or the first failure.
def _connectionName(self, name: str | None) -> str: (source)

Validate selection against the configured named backends.

Parameters
name:str | NoneExplicit selection or central default.
Returns
strExisting configured connection name.
async def _createDriver(self, name: str) -> IQueueDriver: (source)

Construct a configured driver through framework database services.

Parameters
name:strValidated configured connection name.
Returns
orionis.queues.contracts.driver.IQueueDriverDriver whose real I/O starts with its first operation.
async def _submit(self, job: BaseJob, connection: str | None, queue: str | None, delay: float) -> str: (source)

Serialize validated job options and submit to the selected backend.

Parameters
job:orionis.queues.BaseJobJob containing only declared serializable state.
connection:str | NoneExplicit backend selection.
queue:str | NoneExplicit channel selection.
delay:floatDelay in seconds before availability.
Returns
strDispatch identifier.
async def boot(self): (source)

Register jobs from the application's configured jobs path.

Returns
NoneRegister discovered job classes with the shared serializer.
Raises
orionis.queues.exceptions.QueueConfigurationErrorIf the jobs path is invalid or a discovered module cannot be imported.
async def close(self): (source)

Release queue-owned resources without closing shared database services.

Returns
NoneNo return value.
Raises
orionis.queues.exceptions.QueueConfigurationErrorIf initialization requests a shutdown that would wait for itself.
asyncio.CancelledErrorAfter owned cleanup finishes when the caller is cancelled.
ExceptionThe first ordinary cleanup error after every resource is attempted.
async def connection(self, name: str | None = None) -> IQueueDriver: (source)

Resolve one shared lazy driver for the selected named connection.

Parameters
name:str | None, optionalExplicit connection or central default.
Returns
orionis.queues.contracts.driver.IQueueDriverBackend shared by its logical channels.
def dispatch(self, job: BaseJob) -> PendingDispatch: (source)

Create one awaitable dispatch without serializing or persisting data.

Parameters
job:orionis.queues.BaseJobApplication job containing persistent constructor state.
Returns
orionis.queues.PendingDispatchFluent operation submitted only when awaited.
async def failed(self) -> IFailedJobRepository: (source)

Resolve durable failed-job storage only when first requested.

Returns
orionis.queues.contracts.failed_repository.IFailedJobRepositoryRepository shared by all queue connections.
async def migrate(self): (source)

Create every configured database queue table and failed-job storage.

Returns
NoneCreate missing tables with their configured names and SQL connection prefixes, preserving existing data and lazy backend initialization.
Raises
orionis.database.DatabaseExceptionIf a configured SQL connection cannot be resolved or its DDL fails.
orionis.queues.exceptions.QueueStorageErrorIf a database does not enforce the required unique constraints.
async def retryFailed(self, failed_id: str) -> str: (source)

Requeue preserved job data with attempts reset by a fresh push.

Parameters
failed_id:strFailure record identifier.
Returns
strRestored job identifier.
async def worker(self, connection: str | None = None, queues: tuple[str, ...] | None = None, concurrency: int | None = None) -> Worker: (source)

Create an independent persistent worker using validated defaults.

Parameters
connection:str | None, optionalExplicit backend or central default.
queues:tuple[str, ...] | None, optionalChannels ordered by priority.
concurrency:int | None, optionalSimultaneous job executions or configured default.
Returns
orionis.queues.worker.WorkerConsumer runtime sharing the existing application container.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Existing application container.

Validated configuration used to construct and operate the service.

_driver_lock = (source)

Synchronization primitive controlling access to driver lock.

Task currently initializing a driver under its publication lock.

Configured backend drivers cached by their registered names.

Backend retaining failed-job records.

_failed_lock = (source)

Synchronization primitive controlling access to failed lock.

Task currently initializing the failed-job repository.

_serializer = (source)

Singleton registered-job serializer.