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 Scheduler(BaseEntity): (source)
Represent the task scheduler configuration for the application.
| Method | __post |
Validate and normalize the scheduler configuration after init. |
| Method | __validate |
Validate the coalesce property. |
| Method | __validate |
Validate the jitter property. |
| Method | __validate |
Validate the max_instances property. |
| Method | __validate |
Validate the misfire_grace_time property. |
| Method | __validate |
Validate the replace_existing property. |
| Method | __validate |
Validate and normalize the store property. |
| Method | __validate |
Validate and convert the stores property. |
| Instance Variable | coalesce |
Whether missed runs of a job are collapsed into a single run. Defaults to True. |
| Instance Variable | jitter |
Maximum number of seconds of random delay applied to job execution to avoid thundering-herd effects. Defaults to 0. |
| Instance Variable | max |
Maximum number of concurrently running instances allowed for a single scheduled job. Defaults to 1. |
| Instance Variable | misfire |
Number of seconds a job is allowed to run late before it is considered misfired. Defaults to 30. |
| Instance Variable | replace |
Whether adding a job with an already registered id replaces the previous definition. Defaults to True so the declarative task list is always reconciled against a persistent job store (e.g. database/redis... |
| Instance Variable | store |
The default job store used by the task scheduler. Accepts a Drivers enum member or a plain string (e.g. 'memory', 'redis'). Resolved from the TASKS_STORE environment variable or Drivers.MEMORY.value. |
| Instance Variable | stores |
Configuration for the available scheduler job stores. Defaults to a Stores instance backed by the in-memory job store. |
Inherited from BaseEntity:
| Class Method | _cached |
Retrieve field definitions and normalized types cached by class. |
| Method | get |
Describe field names, normalized types, defaults, and metadata. |
| Method | to |
Convert the dataclass instance to a recursively copied dictionary. |
| Class Variable | __slots__ |
Undocumented |
Validate and normalize the scheduler configuration after init.
| Returns | |
None | Modifies instance attributes in place via object.__setattr__. |
| Raises | |
TypeError | If any property does not match its expected type. |
ValueError | If any property fails its value validation. |
Validate the jitter property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If jitter is not an integer. |
ValueError | If jitter is negative. |
Validate the max_instances property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If max_instances is not an integer. |
ValueError | If max_instances is lower than 1. |
Validate the misfire_grace_time property.
| Returns | |
None | This method performs validation and returns None. |
| Raises | |
TypeError | If misfire_grace_time is not an integer or None. |
ValueError | If misfire_grace_time is lower than 1. |
Validate and normalize the store property.
| Returns | |
None | Normalizes store to its canonical string value via object.__setattr__. |
| Raises | |
TypeError | If store is neither a Drivers enum nor a string. |
ValueError | If store is a string that does not match any valid driver. |
Maximum number of seconds of random delay applied to job execution to avoid thundering-herd effects. Defaults to 0.
Whether adding a job with an already registered id replaces the previous definition. Defaults to True so the declarative task list is always reconciled against a persistent job store (e.g. database/redis) on every restart, instead of raising ConflictingIdError for jobs that already exist from a previous run.