This document describes an older version of Celery (2.1).
For the latest stable version please
go here.
Backend: Base - celery.backends.base
celery.backends.base
-
class celery.backends.base.BaseBackend(*args, **kwargs)
The base backend class. All backends should inherit from this.
-
EXCEPTION_STATES = frozenset(['FAILURE', 'RETRY', 'REVOKED'])
-
READY_STATES = frozenset(['FAILURE', 'REVOKED', 'SUCCESS'])
-
exception TimeoutError
The operation timed out.
-
BaseBackend.UNREADY_STATES = frozenset(['STARTED', 'RECEIVED', 'RETRY', 'PENDING'])
-
BaseBackend.cleanup()
Backend cleanup. Is run by
celery.task.DeleteExpiredTaskMetaTask.
-
BaseBackend.encode_result(result, status)
-
BaseBackend.exception_to_python(exc)
Convert serialized exception to Python exception.
-
BaseBackend.forget(task_id)
-
BaseBackend.get_result(task_id)
Get the result of a task.
-
BaseBackend.get_status(task_id)
Get the status of a task.
-
BaseBackend.get_traceback(task_id)
Get the traceback for a failed task.
-
BaseBackend.mark_as_done(task_id, result)
Mark task as successfully executed.
-
BaseBackend.mark_as_failure(task_id, exc, traceback=None)
Mark task as executed with failure. Stores the execption.
-
BaseBackend.mark_as_retry(task_id, exc, traceback=None)
Mark task as being retries. Stores the current
exception (if any).
-
BaseBackend.mark_as_revoked(task_id)
-
BaseBackend.mark_as_started(task_id, **meta)
Mark a task as started
-
BaseBackend.prepare_exception(exc)
Prepare exception for serialization.
-
BaseBackend.prepare_value(result)
Prepare value for storage.
-
BaseBackend.process_cleanup()
Cleanup actions to do at the end of a task worker process.
-
BaseBackend.reload_task_result(task_id)
Reload task result, even if it has been previously fetched.
-
BaseBackend.reload_taskset_result(task_id)
Reload taskset result, even if it has been previously fetched.
-
BaseBackend.restore_taskset(taskset_id, cache=True)
Get the result of a taskset.
-
BaseBackend.save_taskset(taskset_id, result)
Store the result and status of a task.
-
BaseBackend.store_result(task_id, result, status)
Store the result and status of a task.
-
BaseBackend.wait_for(task_id, timeout=None)
Wait for task and return its result.
If the task raises an exception, this exception
will be re-raised by wait_for().
If timeout is not None, this raises the
celery.exceptions.TimeoutError exception if the operation
takes longer than timeout seconds.
-
class celery.backends.base.BaseDictBackend(*args, **kwargs)
-
forget(task_id)
-
get_result(task_id)
Get the result of a task.
-
get_status(task_id)
Get the status of a task.
-
get_task_meta(task_id, cache=True)
-
get_taskset_meta(taskset_id, cache=True)
-
get_traceback(task_id)
Get the traceback for a failed task.
-
reload_task_result(task_id)
-
reload_taskset_result(taskset_id)
-
restore_taskset(taskset_id, cache=True)
Get the result for a taskset.
-
save_taskset(taskset_id, result)
Store the result of an executed taskset.
-
store_result(task_id, result, status, traceback=None)
Store task result and status.
-
class celery.backends.base.KeyValueStoreBackend(*args, **kwargs)
-
delete(key)
-
get(key)
-
get_key_for_task(task_id)
Get the cache key for a task by id.
-
get_key_for_taskset(task_id)
Get the cache key for a task by id.
-
set(key, value)