Task Result - celery.result¶
Asynchronous result types.
- class celery.result.AsyncResult(task_id)¶
- Pending task result using the default backend. - Parameter: - task_id – see task_id. - task_id¶
- The unique identifier for this task.
 - backend¶
- Instance of celery.backends.DefaultBackend.
 
- class celery.result.BaseAsyncResult(task_id, backend)¶
- Base class for pending result, supports custom task meta backend - Parameters: - task_id¶
- The unique identifier for this task.
 - backend¶
- The task result backend used.
 - is_done()¶
- Returns True if the task executed successfully. - Return type: - bool 
 - ready()¶
- Returns True if the task executed successfully, or raised an exception. If the task is still pending, or is waiting for retry then False is returned. - Return type: - bool 
 - result¶
- When the task has been executed, this contains the return value. - If the task raised an exception, this will be the exception instance. 
 - status¶
- The current status of the task. - Can be one of the following: - PENDING - The task is waiting for execution. - RETRY - The task is to be retried, possibly because of failure. - FAILURE - The task raised an exception, or has been retried more times than its limit. The result attribute contains the exception raised. - DONE - The task executed successfully. The result attribute contains the resulting value. 
 - wait(timeout=None)¶
- Wait for task, and return the result when it arrives. - Parameter: - timeout – How long to wait in seconds, before the operation times out. - Raises celery.timer.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. 
 
- class celery.result.TaskSetResult(taskset_id, subtask_ids)¶
- Working with celery.task.TaskSet results. - An instance of this class is returned by celery.task.TaskSet.run(). It lets you inspect the status and return values of a taskset as a single entity. - Option taskset_id: - see taskset_id. - Option subtask_ids: - see subtask_ids. - taskset_id¶
- The UUID of the taskset itself.
 - subtask_ids¶
- The list of task UUID’s for all of the subtasks.
 - subtasks¶
- A list of AsyncResult` instances for all of the subtasks.
 - completed_count()¶
- Task completion count. - Returns: - the number of tasks completed. 
 - failed()¶
- Did the taskset fail? - Returns: - True if any of the tasks in the taskset failed. (i.e., raised an exception) 
 - iterate()¶
- 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. 
 - itersubtasks()¶
- Taskset subtask iterator. - Returns: - an iterator for iterating over the tasksets AsyncResult objects. 
 - join(timeout=None)¶
- Gather the results for all of the tasks in the taskset, and return a list with them ordered by the order of which they were called. - Parameter: - timeout – The time in seconds, how long it will wait for results, before the operation times out. - Raises celery.timer.TimeoutError: - if timeout is not None and the operation takes longer than timeout seconds. - If any of the tasks raises an exception, the exception will be reraised by join(). - Returns: - list of return values for all tasks in the taskset. 
 - ready()¶
- Is the task readyu? - Returns: - True if all of the tasks in the taskset has been executed. 
 - successful()¶
- Was the taskset successful? - Returns: - True if all of the tasks in the taskset finished successfully (i.e. did not raise an exception). 
 - total¶
- The total number of tasks in the celery.task.TaskSet.
 - waiting()¶
- Is the taskset waiting? - Returns: - True if any of the tasks in the taskset is still waiting for execution.