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

Clock Service - celery.beat

Periodic Task Scheduler

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()
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:
name

The task name.

schedule

The schedule (run_every/crontab)

args

Args to apply.

kwargs

Keyword arguments to apply.

last_run_at

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

total_run_count

Total number of times this periodic task has been executed.

is_due()

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

next(last_run_at=None)

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

update(other)

Update values from another entry.

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

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

Scheduler for periodic tasks.

Parameters:
schedule

The schedule dict/shelve.

logger

The logger to use.

max_interval

Maximum time to sleep between re-checking the schedule.

Entry

alias of ScheduleEntry

Publisher

alias of TaskPublisher

add(**kwargs)
apply_async(entry, publisher=None, **kwargs)
close()
get_schedule()
info
maybe_due(entry, publisher=None)
merge_inplace(b)
reserve(entry)
schedule
send_task(*args, **kwargs)
setup_schedule()
sync()
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=300, schedule={}, schedule_filename='celerybeat-schedule', scheduler_cls=None)
get_scheduler(lazy=False)
scheduler
scheduler_cls

alias of PersistentScheduler

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

Previous topic

Thread Pool Support EXPERIMENTAL - celery.concurrency.threads

Next topic

Backends - celery.backends

This Page