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 QueueManager(IQueueManager): (source)
Constructor: QueueManager(app, serializer)
Resolve lazy connections and expose the canonical deferred dispatch API.
| Method | __init__ |
Validate and serialize queue settings without opening backend clients. |
| Async Method | _close |
Detach initialized resources and attempt every owned cleanup. |
| Method | _connection |
Validate selection against the configured named backends. |
| Async Method | _create |
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 | retry |
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 |
Synchronization primitive controlling access to driver lock. |
| Instance Variable | _driver |
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 |
Synchronization primitive controlling access to failed lock. |
| Instance Variable | _failed |
Task currently initializing the failed-job repository. |
| Instance Variable | _serializer |
Singleton registered-job serializer. |
Validate and serialize queue settings without opening backend clients.
| Parameters | |
app:orionis.IApplication | Existing application container. |
serializer:orionis.queues.contracts.serializer.IJobSerializer | Singleton registered-job serializer. |
| Returns | |
None | Retain the normalized wire settings for lazy backend resolution. |
| Raises | |
TypeError | If queue settings have invalid types or unsupported fields. |
ValueError | If queue settings or their storage relationships are invalid. |
Detach initialized resources and attempt every owned cleanup.
| Returns | |
None | No return value. |
| Raises | |
BaseException | Cancellation in preference to ordinary errors, or the first failure. |
Validate selection against the configured named backends.
| Parameters | |
name:str | None | Explicit selection or central default. |
| Returns | |
str | Existing configured connection name. |
Construct a configured driver through framework database services.
| Parameters | |
name:str | Validated configured connection name. |
| Returns | |
orionis.queues.contracts.driver.IQueueDriver | Driver whose real I/O starts with its first operation. |
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.BaseJob | Job containing only declared serializable state. |
connection:str | None | Explicit backend selection. |
queue:str | None | Explicit channel selection. |
delay:float | Delay in seconds before availability. |
| Returns | |
str | Dispatch identifier. |
Register jobs from the application's configured jobs path.
| Returns | |
None | Register discovered job classes with the shared serializer. |
| Raises | |
orionis.queues.exceptions.QueueConfigurationError | If the jobs path is invalid or a discovered module cannot be imported. |
Release queue-owned resources without closing shared database services.
| Returns | |
None | No return value. |
| Raises | |
orionis.queues.exceptions.QueueConfigurationError | If initialization requests a shutdown that would wait for itself. |
asyncio.CancelledError | After owned cleanup finishes when the caller is cancelled. |
Exception | The first ordinary cleanup error after every resource is attempted. |
Resolve one shared lazy driver for the selected named connection.
| Parameters | |
name:str | None, optional | Explicit connection or central default. |
| Returns | |
orionis.queues.contracts.driver.IQueueDriver | Backend shared by its logical channels. |
Create one awaitable dispatch without serializing or persisting data.
| Parameters | |
job:orionis.queues.BaseJob | Application job containing persistent constructor state. |
| Returns | |
orionis.queues.PendingDispatch | Fluent operation submitted only when awaited. |
Resolve durable failed-job storage only when first requested.
| Returns | |
orionis.queues.contracts.failed_repository.IFailedJobRepository | Repository shared by all queue connections. |
Create every configured database queue table and failed-job storage.
| Returns | |
None | Create missing tables with their configured names and SQL connection prefixes, preserving existing data and lazy backend initialization. |
| Raises | |
orionis.database.DatabaseException | If a configured SQL connection cannot be resolved or its DDL fails. |
orionis.queues.exceptions.QueueStorageError | If a database does not enforce the required unique constraints. |
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, optional | Explicit backend or central default. |
queues:tuple[str, ...] | None, optional | Channels ordered by priority. |
concurrency:int | None, optional | Simultaneous job executions or configured default. |
| Returns | |
orionis.queues.worker.Worker | Consumer runtime sharing the existing application container. |