Spec-Zone.ru › Celery

celery.utils.timer2

Scheduler for Python functions.

Note

This is used for the thread-based worker only, not for amqp/redis/sqs/qpid where kombu.asynchronous.timer is used.

classcelery.utils.timer2.Entry(fun, args=None, kwargs=None)

Schedule Entry.

args
cancel()
canceled
propertycancelled
fun
kwargs
tref
celery.utils.timer2.Schedule

alias of Timer

classcelery.utils.timer2.Timer(schedule:Timer|None=None, on_error:Callable[[Exception],None]|None=None, on_tick:Callable[[float],None]|None=None, on_start:Callable[[Timer],None]|None=None, max_interval:float|None=None, **kwargs:Any)

Timer thread.

Note

This is only used for transports not supporting AsyncIO.

classEntry(fun, args=None, kwargs=None)

Schedule Entry.

args
cancel()
canceled
propertycancelled
fun
kwargs
tref
Schedule

alias of Timer

call_after(*args:Any, **kwargs:Any) → Entry
call_at(*args:Any, **kwargs:Any) → Entry
call_repeatedly(*args:Any, **kwargs:Any) → Entry
cancel(tref:Entry) → None
clear() → None
empty() → bool
ensure_started() → None
enter(entry:Entry, eta:float, priority:int|None=None) → Entry
enter_after(*args:Any, **kwargs:Any) → Entry
exit_after(secs:float, priority:int=10) → None
next() → float|None
on_tick:Callable[[float],None]|None=None
propertyqueue:list
run() → None

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

running:bool=False
stop() → None
celery.utils.timer2.to_timestamp(d, default_timezone=zoneinfo.ZoneInfo(key='UTC'), time=<built-in function monotonic>)

Convert datetime to timestamp.

If d’ is already a timestamp, then that will be used.

Copyright © 2017-2026 Asif Saif Uddin, core team & contributors. All rights reserved.
Celery is licensed under The BSD License (3 Clause, also known as the new BSD license). The license is an OSI approved Open Source license and is GPL-compatible.
https://docs.celeryq.dev/en/stable/internals/reference/celery.utils.timer2.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API