你正在阅读 Celery 3.1 的文档。开发版本文档见: 此处.

celery.beat

celery.beat

The periodic task scheduler.

exception celery.beat.SchedulingError[源代码]

An error occured while scheduling a task.

class celery.beat.ScheduleEntry(name=None, task=None, last_run_at=None, total_run_count=None, schedule=None, args=(), kwargs={}, options={}, relative=False, app=None)[源代码]

An entry in the scheduler.

参数:
args = None

Positional arguments to apply.

is_due()[源代码]

See 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)

Return 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(app, schedule=None, max_interval=None, Publisher=None, lazy=False, **kwargs)[源代码]

Scheduler for periodic tasks.

The celery beat program may instantiate this class multiple times for introspection purposes, but then with the lazy argument set. It is important for subclasses to be idempotent when this argument is set.

参数:
  • schedule – see schedule.
  • max_interval – see max_interval.
  • lazy – Do not set up the schedule.
Entry

ScheduleEntry 的别名

add(**kwargs)[源代码]
apply_async(entry, publisher=None, **kwargs)[源代码]
close()[源代码]
connection None[源代码]
get_schedule()[源代码]
info None[源代码]
install_default_entries(data)[源代码]
logger = <celery.utils.log.ProcessAwareLogger object at 0xc06ad6c>
max_interval = 300

Maximum time to sleep between re-checking the schedule.

maybe_due(entry, publisher=None)[源代码]
merge_inplace(b)[源代码]
publisher None[源代码]
reserve(entry)[源代码]
schedule None

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_)[源代码]
class celery.beat.PersistentScheduler(*args, **kwargs)[源代码]
close()[源代码]
get_schedule()[源代码]
info None[源代码]
known_suffixes = ('', '.db', '.dat', '.bak', '.dir')
persistence = <module 'shelve' from '/usr/lib/python2.7/shelve.pyc'>
schedule None
set_schedule(schedule)[源代码]
setup_schedule()[源代码]
sync()[源代码]
class celery.beat.Service(app, max_interval=None, schedule_filename=None, scheduler_cls=None)[源代码]
get_scheduler(lazy=False)[源代码]
scheduler None[源代码]
scheduler_cls

PersistentScheduler 的别名

start(embedded_process=False)[源代码]
stop(wait=False)[源代码]
sync()[源代码]
celery.beat.EmbeddedService(*args, **kwargs)[源代码]

Return embedded clock service.

参数:thread – Run threaded instead of as a separate process. Uses multiprocessing by default, if available.

上一个主题

celery.events.state

下一个主题

celery.apps.worker

本页