This document describes an older version of Celery (2.5). For the latest stable version please go here.

celery.beat

celery.beat

The Celery periodic task scheduler.

copyright:
  1. 2009 - 2012 by Ask Solem.
license:

BSD, see LICENSE for more details.

celery.beat.EmbeddedService(*args, **kwargs)

Return embedded clock service.

Parameters:thread – Run threaded instead of as a separate process. Default is False.
class celery.beat.PersistentScheduler(*args, **kwargs)
close()
get_schedule()
info
persistence = <module 'shelve' from '/usr/lib/python2.7/shelve.pyc'>
setup_schedule()
sync()
class celery.beat.ScheduleEntry(name=None, task=None, last_run_at=None, total_run_count=None, schedule=None, args=(), kwargs={}, options={}, relative=False)

An entry in the scheduler.

Parameters:
args = None

Positional arguments to apply.

is_due()

See celery.task.base.PeriodicTask.is_due().

kwargs = None

Keyword arguments to apply.

last_run_at = None

The time and date of when this task was last scheduled.

name = None

The task name

next(last_run_at=None)

Returns a new instance of the same class, but with its date and count fields updated.

options = None

Task execution options.

schedule = None

The schedule (run_every/crontab)

total_run_count = 0

Total number of times this task has been scheduled.

update(other)

Update values from another entry.

Does only update “editable” fields (task, schedule, args, kwargs, options).

class celery.beat.Scheduler(schedule=None, logger=None, max_interval=None, app=None, Publisher=None, lazy=False, **kwargs)

Scheduler for periodic tasks.

Parameters:
Entry

alias of ScheduleEntry

add(**kwargs)
apply_async(entry, publisher=None, **kwargs)
close()
connection
get_schedule()
info
install_default_entries(data)
logger = None

Current logger.

max_interval = 1

Maximum time to sleep between re-checking the schedule.

maybe_due(entry, publisher=None)
merge_inplace(b)
publisher
reserve(entry)
schedule

The schedule dict/shelve.

send_task(*args, **kwargs)
set_schedule(schedule)
setup_schedule()
should_sync()
sync()
sync_every = 180

How often to sync the schedule (3 minutes by default)

tick()

Run a tick, that is one iteration of the scheduler.

Executes all due tasks.

update_from_dict(dict_)
exception celery.beat.SchedulingError

An error occured while scheduling a task.

class celery.beat.Service(logger=None, max_interval=None, schedule_filename=None, scheduler_cls=None, app=None)
get_scheduler(lazy=False)
scheduler
scheduler_cls

alias of PersistentScheduler

start(embedded_process=False)
stop(wait=False)
sync()

Previous topic

celery.concurrency.threads‡ (minefield)

Next topic

celery.backends

This Page