Task Result - celery.result

Asynchronous result types.

class celery.result.AsyncResult(task_id)

Pending task result using the default backend.

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, takes backend argument.

task_id
The unique identifier for this task.
backend
The task result backend used.
get()
Alias to wait().
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 is executed, this contains the return value.

If the task resulted in failure, this will be the exception instance raised.

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.
successful()
Alias to is_done().
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.

Previous topic

Tasks - celery.task

Next topic

Task Registry - celery.registry

This Page