Wraps the task in a jail, which catches all exceptions, and saves the status and result of the task execution to the task meta backend.
If the call was successful, it saves the result to the task result backend, and sets the task status to "DONE".
If the call raises celery.exceptions.RetryTaskError, it extracts the original exception, uses that as the result and sets the task status to "RETRY".
If the call results in an exception, it saves the exception as the task result, and sets the task status to "FAILURE".
Parameters: |
|
---|---|
Returns: | the function return value on success, or the exception instance on failure. |
Handle successful execution.
If the callable has a on_success function, it as called with retval as argument.
Parameter: | retval – The return value. |
---|
Apply the task locally.
This will block until the task completes, and returns a celery.result.EagerResult instance.
Run a task asynchronously by the celery daemon(s).
Parameters: |
|
---|
Delay a task for execution by the celery daemon.
Parameters: |
|
---|---|
Raises celery.exceptions.NotRegistered: | |
exception if no such task has been registered in the task registry. |
|
Return type: |
Example
>>> r = delay_task("update_record", name="George Constanza", age=32)
>>> r.ready()
True
>>> r.result
"Record was updated"