orangeqs.juice.task#
Task definitions for services.
Package Contents#
Classes#
Base class for tasks that can be executed by a service. |
|
Future that resolves to the result of a task. |
|
Result information of a successfully completed task. |
|
Result information of a task that raised an error. |
Data#
Union of all possible task results.
Either |
API#
- class orangeqs.juice.task.Task(/, **data: Any)#
Bases:
pydantic.BaseModelBase class for tasks that can be executed by a service.
- classmethod type() str#
Return the unique name of the task type.
This is used to validate the model on the service side and route the task to the correct handler. Defaults to the class name.
Warning: The name of the type should be unique per service. Can be overridden to prevent name clashes.
Return a set of field names to exclude from the display name.
By default, this excludes the
parallelclass variable.
- class orangeqs.juice.task.TaskFuture(task_id: str)#
Bases:
asyncio.Future[orangeqs.juice.task._task._T]Future that resolves to the result of a task.
- orangeqs.juice.task.TaskResult#
None
Union of all possible task results. Either
TaskResultOkorTaskResultError.
- class orangeqs.juice.task.TaskResultOk(/, **data: Any)#
Bases:
pydantic.BaseModelResult information of a successfully completed task.
- class orangeqs.juice.task.TaskResultError(/, **data: Any)#
Bases:
pydantic.BaseModelResult information of a task that raised an error.
- exception orangeqs.juice.task.TaskExecutionError(error: orangeqs.juice.task._schemas.TaskResultError)#
Bases:
ExceptionTask execution error, raised if a task fails.
Raised by
request()andexecute()when a task fails withcheck=True- error: orangeqs.juice.task._schemas.TaskResultError#
None
The wrapped error details.