AsyncResult¶
chicory.AsyncResult ¶
Bases: Generic[T]
Asynchronous result handler for task results.
Source code in src/chicory/result.py
get
async
¶
Wait for and return the task result.
Polls the backend at regular intervals until the task reaches a
terminal state (SUCCESS or FAILURE).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float | None
|
Maximum seconds to wait. |
None
|
poll_interval
|
float
|
Seconds between backend polls (default |
0.1
|
Returns:
| Type | Description |
|---|---|
T | None
|
The task's return value, or |
Raises:
| Type | Description |
|---|---|
TimeoutError
|
If timeout is reached before the task completes. |
BackendNotConfiguredError
|
If no backend is attached. |
Exception
|
Re-raised from the task if it ended in |
Source code in src/chicory/result.py
state
async
¶
Get the current task state.
Returns:
| Type | Description |
|---|---|
TaskState
|
The current |
TaskState
|
|
Raises:
| Type | Description |
|---|---|
BackendNotConfiguredError
|
If no backend is attached. |
Source code in src/chicory/result.py
ready
async
¶
Check if the task is complete (success or failure).
Returns:
| Type | Description |
|---|---|
bool
|
|
failed
async
¶
Check if the task has failed.
Returns:
| Type | Description |
|---|---|
bool
|
|