celery.utils.timer2 — Celery 5.5.2 documentation (original) (raw)

This document describes the current stable version of Celery (5.5). For development docs,go here.

Scheduler for Python functions.

class celery.utils.timer2.Entry(fun, args=None, kwargs=None)[source]

Schedule Entry.

args

cancel()[source]

canceled

property cancelled

fun

kwargs

tref

celery.utils.timer2.Schedule

alias of Timer

class celery.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)[source]

Timer thread.

Note

This is only used for transports not supporting AsyncIO.

class Entry(fun, args=None, kwargs=None)

Schedule Entry.

args

cancel()

canceled

property cancelled

fun

kwargs

tref

Schedule

alias of Timer

call_after(*args: Any, **kwargs: Any) → Entry[source]

call_at(*args: Any, **kwargs: Any) → Entry[source]

call_repeatedly(*args: Any, **kwargs: Any) → Entry[source]

cancel(tref: Entry) → None[source]

clear() → None[source]

empty() → bool[source]

ensure_started() → None[source]

enter(entry: Entry, eta: float, priority: int | None = None) → Entry[source]

enter_after(*args: Any, **kwargs: Any) → Entry[source]

exit_after(secs: float, priority: int = 10) → None[source]

next() → float | None

on_tick_: Callable[[float], None] | None_ = None

property queue_: list_

run() → None[source]

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[source]

celery.utils.timer2.to_timestamp(d, default_timezone=zoneinfo.ZoneInfo(key='UTC'), time=)[source]

Convert datetime to timestamp.

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