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 BackgroundTask(IBackgroundTask): (source)
Known subclasses: orionis.background.BackgroundTasks
Constructor: BackgroundTask(func, *args, **kwargs)
Represent a background task that can be executed asynchronously.
| Parameters | |
| func | The function to be executed in the background. |
| *args | Positional arguments to pass to the function. |
| **kwargs | Keyword arguments to pass to the function. |
| Async Method | __call__ |
Execute the background task, handling both sync and async functions. |
| Async Method | __execute |
Run synchronous work and release its result if the caller cancels. |
| Method | __init__ |
Initialize the BackgroundTask instance. |
| Async Method | run |
Run the background task. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | __args |
Positional arguments to pass to the function. |
| Instance Variable | __func |
The function to be executed in the background. |
| Instance Variable | __is |
Is async produced by is_async_callable. |
| Instance Variable | __kwargs |
Keyword arguments to pass to the function. |
overridden in
orionis.background.BackgroundTasksExecute the background task, handling both sync and async functions.
| Returns | |
None | This method does not return a value. |
Run synchronous work and release its result if the caller cancels.
| Returns | |
object | Worker result when the caller remains active. |
| Raises | |
asyncio.CancelledError | After the worker has finished and an abandoned awaitable is released. |
Exception | If the worker fails while the caller is still awaiting it. |
overridden in
orionis.background.BackgroundTasksInitialize the BackgroundTask instance.
| Parameters | |
func:collections.abc.Callable | The function to be executed in the background. |
*args:object | Positional arguments to pass to the function. |
**kwargs:object | Keyword arguments to pass to the function. |
| Returns | |
None | This method does not return a value. |
overridden in
orionis.background.BackgroundTasksDeclare the instance attribute slots reserved by this class.