This document describes an older version of Celery (2.1). For the latest stable version please go here.
Tasks can only be executed once, as they might change world-wide state.
The task has invalid data or is not properly constructed.
A request for task execution.
Parameters: |
---|
Kind of task. Must be a name registered in the task registry.
UUID of the task.
List of positional arguments to apply to the task.
Mapping of keyword arguments to apply to the task.
Callback called when the task should be acknowledged.
The original message sent. Used for acknowledging the message.
Set to True if the task has been executed. A task should only be executed once.
Additional delivery info, e.g. the contains the path from producer to consumer.
Set to True if the task has been acknowledged.
Execute the task in a WorkerTaskTrace.
Parameters: |
|
---|
Like execute(), but using the multiprocessing pool.
Parameters: |
|
---|
Extend the tasks keyword arguments with standard task arguments.
Currently these are logfile, loglevel, task_id, task_name, task_retries, and delivery_info.
See celery.task.base.Task.run() for more information.
Create a TaskRequest from a task message sent by celery.messaging.TaskPublisher.
Raises UnknownTaskError: | |
---|---|
if the message does not describe a task, the message is also rejected. |
:returns TaskRequest:
Handler called when task is accepted by worker pool.
The handler used if the task raised an exception.
The handler used if the task was successfully processed ( without raising an exception).
Wraps the task in a jail, 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 "SUCCESS".
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 evaluated functions return value on success, or the exception instance on failure. |
Execute, trace and store the result of the task.
Handle exception.
Handle retry exception.
Handle successful execution.
This is a pickleable method used as a target when applying to pools.
It’s the same as:
>>> WorkerTaskTrace(task_name, *args, **kwargs).execute_safe()