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 ISchedule(ABC): (source)
Undocumented
| Async Method | boot |
Boot the scheduler and register all configured tasks. |
| Method | command |
Add a command for fluent configuration. |
| Async Method | info |
Retrieve information about all loaded fluent tasks. |
| Method | is |
Determine if the scheduler is currently paused. |
| Method | is |
Determine if the scheduler is currently running. |
| Method | is |
Determine if the scheduler is currently stopped. |
| Method | on |
Register a listener for a scheduler event. |
| Method | pause |
Pause the scheduler if it is running. |
| Method | pause |
Pause a running task by its signature. |
| Method | remove |
Remove all tasks from the scheduler. |
| Method | remove |
Remove a task from the scheduler by its signature. |
| Method | resume |
Resume the scheduler if it is paused. |
| Method | resume |
Resume a paused task by its signature. |
| Method | shutdown |
Shut down the task scheduler safely without waiting for running tasks. |
| Method | state |
Return the current scheduler state as a string. |
| Async Method | wait |
Wait for the scheduler shutdown to complete. |
Boot the scheduler and register all configured tasks.
Load available command signatures, validate and load fluent tasks, initialize the scheduler, register event listeners, and add all jobs to the scheduler.
| Returns | |
None | This method does not return a value but initializes the scheduler. |
str, args: list[ str] | None = None, purpose: str | None = None) -> ITask:
(source)
¶
Add a command for fluent configuration.
| Parameters | |
signature:str | Unique signature of the command to schedule. |
args:list[str] | None, optional | Arguments for the command. Defaults to None. |
purpose:str | None, optional | Description of the command's purpose. |
| Returns | |
ITask | Task instance for further configuration. |
| Raises | |
RuntimeError | If the scheduler has already been started. |
TypeError | If the signature is not a non-empty string or arguments are invalid. |
Determine if the scheduler is currently paused.
| Returns | |
bool | True if the scheduler state is "PAUSED", otherwise False. |
Determine if the scheduler is currently running.
| Returns | |
bool | True if the scheduler state is "RUNNING", otherwise False. |
Determine if the scheduler is currently stopped.
| Returns | |
bool | True if the scheduler state is "STOPPED", otherwise False. |
Register a listener for a scheduler event.
| Parameters | |
event:SchedulerEvent | The scheduler event to listen for. |
listener:Callable | The callable to invoke when the event occurs. |
| Returns | |
Self | The Schedule instance for method chaining. |
| Raises | |
RuntimeError | If the scheduler has already been booted. |
TypeError | If event is not a SchedulerEvent or listener is not callable. |
Pause the scheduler if it is running.
| Parameters | |
self:Schedule | The Schedule instance. |
| Returns | |
bool | True if the scheduler was successfully paused. |
| Raises | |
RuntimeError | If the scheduler is not started or not running. |
Pause a running task by its signature.
Notes
This method pauses a running task in the scheduler.
| Parameters | |
signature:str | Unique identifier of the task to pause. |
| Returns | |
bool | True if the task was successfully paused, otherwise raises an exception. |
| Raises | |
RuntimeError | If the scheduler has not been started or the task is not running. |
ValueError | If the specified task does not exist. |
Remove all tasks from the scheduler.
Notes
This method removes all tasks from the scheduler and updates internal state.
| Returns | |
bool | True if all tasks were successfully removed, otherwise raises an exception. |
| Raises | |
RuntimeError | If the scheduler has not been started or an error occurs during removal. |
Remove a task from the scheduler by its signature.
Notes
This method removes a task from the scheduler and updates internal state.
| Parameters | |
signature:str | Unique identifier of the task to remove. |
| Returns | |
bool | True if the task was successfully removed, otherwise raises an exception. |
| Raises | |
RuntimeError | If the scheduler has not been started or the task is not found. |
ValueError | If the specified task does not exist. |
Resume the scheduler if it is paused.
| Parameters | |
self:Schedule | The Schedule instance. |
| Returns | |
bool | True if the scheduler was successfully resumed. |
| Raises | |
RuntimeError | If the scheduler is not started or not paused. |
Resume a paused task by its signature.
Notes
This method resumes a paused task in the scheduler.
| Parameters | |
signature:str | Unique identifier of the task to resume. |
| Returns | |
bool | True if the task was successfully resumed, otherwise raises an exception. |
| Raises | |
RuntimeError | If the scheduler has not been started or the task is not paused. |
ValueError | If the specified task does not exist. |
Shut down the task scheduler safely without waiting for running tasks.
This method terminates the scheduler execution safely. It does not wait for currently executing tasks to complete, but prevents new tasks from starting and cleans up scheduler resources. Ideal for console environments where the process stops immediately after calling this method.
| Parameters | |
wait:int | None, optional | Time in seconds to wait before completing shutdown. Defaults to None. |
| Returns | |
None | This method does not return a value. It initiates graceful shutdown. |
Return the current scheduler state as a string.
| Returns | |
str | The current state of the scheduler, e.g., "RUNNING", "PAUSED", or "STOPPED". |
Wait for the scheduler shutdown to complete.
This method blocks until the shutdown process initiated by the shutdown() method has finished. It provides a way to synchronize with the graceful shutdown process.
| Returns | |
None | This method does not return a value but blocks until shutdown completes. |