This document describes Celery 2.3. For development docs, go here.
Pending task result using the default backend.
Parameters: | task_id – The task uuid. |
---|
Task result store backend to use.
Base class for pending result, supports custom task result backend.
Parameters: |
---|
Error raised for timeouts.
The task result backend to use.
Returns True if the task failed.
Forget about (and possibly remove the result of) this task.
Wait until task is ready, and return its result.
Warning
Waiting for tasks within a task may lead to deadlocks. Please read Avoid launching synchronous subtasks.
Parameters: |
|
---|---|
Raises celery.exceptions.TimeoutError: | |
if timeout is not None and the result does not arrive within timeout seconds. |
If the remote call raised an exception then that exception will be re-raised.
Returns True if the task has been executed.
If the task is still running, pending, or is waiting for retry then False is returned.
When the task has been executed, this contains the return value. If the task raised an exception, this will be the exception instance.
Send revoke signal to all workers.
Any worker receiving the task, or having reserved the task, must ignore it.
The tasks current state.
Possible values includes:
PENDING
The task is waiting for execution.STARTED
The task has been started.RETRY
The task is to be retried, possibly because of failure.FAILURE
The task raised an exception, or has exceeded the retry limit. The result attribute then contains the exception raised by the task.SUCCESS
The task executed successfully. The result attribute then contains the tasks return value.
Returns True if the task executed successfully.
The task uuid.
Get the traceback of a failed task.
Result that we know has already been executed.
The operation timed out.
Wait until the task has been executed and return its result.
Returns True if the task has been executed.
The tasks return value
The tasks state.
Returns True if the task executed without failure.
The traceback if the task failed.
Working with more than one result.
Parameters: | results – List of result instances. |
---|
Add AsyncResult as a new member of the set.
Does nothing if the result is already a member.
Remove all results from this set.
Task completion count.
Returns: | the number of tasks completed. |
---|
Remove result from the set if it is a member.
If it is not a member, do nothing.
Did any of the tasks fail?
Returns: | True if any of the tasks failed. (i.e., raised an exception) |
---|
Forget about (and possible remove the result of) all the tasks.
Backend optimized version of iterate().
New in version 2.2.
Note that this does not support collecting the results for different task types using different backends.
This is currently only supported by the AMQP, Redis and cache result backends.
Iterate over the return values of the tasks as they finish one by one.
Raises: | The exception if any of the tasks raised an exception. |
---|
Gathers the results of all tasks as a list in order.
Note
This can be an expensive operation for result store backends that must resort to polling (e.g. database).
You should consider using join_native() if your backend supports it.
Warning
Waiting for tasks within a task may lead to deadlocks. Please see Avoid launching synchronous subtasks.
Parameters: |
|
---|---|
Raises celery.exceptions.TimeoutError: | |
if timeout is not None and the operation takes longer than timeout seconds. |
Backend optimized version of join().
New in version 2.2.
Note that this does not support collecting the results for different task types using different backends.
This is currently only supported by the AMQP, Redis and cache result backends.
Did all of the tasks complete? (either by success of failure).
Returns: | True if all of the tasks been executed. |
---|
Removes result from the set; it must be a member.
Raises KeyError: | |
---|---|
if the result is not a member. |
List of results in in the set.
Revoke all tasks in the set.
Was all of the tasks successful?
Returns: | True if all of the tasks finished successfully (i.e. did not raise an exception). |
---|
Total number of tasks in the set.
Update set with the union of itself and an iterable with results.
Are any of the tasks incomplete?
Returns: | True if any of the tasks is still waiting for execution. |
---|
An instance of this class is returned by TaskSet‘s apply_async() method.
It enables inspection of the tasks state and return values as a single entity.
Parameters: |
|
---|
Remove this result if it was previously saved.
Depreacted. Use iter(self.results) instead.
Restore previously saved taskset result.
List/iterator of results in the taskset
Save taskset result for later retrieval using restore().
Example:
>>> result.save()
>>> result = TaskSetResult.restore(taskset_id)
The UUID of the taskset.