Celery v0.8.1 (stable) documentation

This Page

Django Model Managers - celery.managers

celery.managers

class celery.managers.MySQLTableLock(table, type='read')

Table lock support for MySQL.

lock_table()
Lock MySQL table.
unlock_table()
Unlock MySQL table.
class celery.managers.PeriodicTaskManager

Manager for celery.models.PeriodicTask models.

get_waiting_tasks()

Get all waiting periodic tasks.

Returns:list of celery.models.PeriodicTaskMeta objects.
init_entries()

Add entries for all registered periodic tasks.

Should be run at worker start.

is_time(last_run_at, run_every)

Check if if it is time to run the periodic task.

Parameters:
  • last_run_at – Last time the periodic task was run.
  • run_every – How often to run the periodic task.
Rtype bool:
class celery.managers.TableLock(table, type='read')

Base class for database table locks. Also works as a NOOP lock.

classmethod acquire(table, type=None)
Acquire table lock.
lock_table()
Lock the table.
release()
Release the lock.
unlock_table()
Release previously locked tables.
class celery.managers.TaskManager

Manager for celery.models.Task models.

delete_expired()
Delete all expired task results.
get_all_expired()
Get all expired task results.
get_task(task_id)
Get task meta for task by task_id.
is_done(task_id)
Returns True if the task was executed successfully.
store_result(task_id, result, status, traceback=None, exception_retry=True)

Store the result and status of a task.

Parameters:
  • task_id – task id
  • result – The return value of the task, or an exception instance raised by the task.
  • status – Task status. See celery.result.AsyncResult.get_status() for a list of possible status values.
  • traceback – The traceback at the point of exception (if the task failed).
  • exception_retry – If True, we try a single retry with transaction rollback on exception
celery.managers.table_lock
alias of TableLock