mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 18:28:11 +08:00
15 lines
492 B
Python
15 lines
492 B
Python
from enum import IntEnum
|
|
|
|
|
|
class TimerStatus(IntEnum):
|
|
"""
|
|
Sentinel values for the countdown timer a worker shares with the sentinel.
|
|
|
|
Any positive value is the number of seconds left before the sentinel
|
|
considers the task timed out and reincarnates the worker.
|
|
"""
|
|
|
|
TIMEOUT = 0 # task timed out, the worker has to be terminated
|
|
IDLE = -1 # waiting for work, or working without a timeout
|
|
RECYCLED = -2 # recycle limit reached, the worker stopped on its own
|