Heart
Bootstep sending event heartbeats.
Attributes
| Attribute | Type | Description |
|---|---|---|
| requires | tuple = (Events,) | A tuple containing the bootstep classes that must be initialized before this heart service can start, specifically requiring the Events step. |
| shutdown | callable = stop | An alias for the stop method used to terminate the heartbeat service during worker shutdown. |
Constructor
Signature
def Heart(
c: Any,
without_heartbeat: boolean = False,
heartbeat_interval: float = None,
**kwargs: dict
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| c | Any | The consumer or parent object context. |
| without_heartbeat | boolean = False | Flag to disable the heartbeat service. |
| heartbeat_interval | float = None | The interval in seconds between heartbeat messages. |
| **kwargs | dict | Additional keyword arguments passed to the parent class. |
Methods
start()
@classmethod
def start(
c: celery.worker.Consumer
) - > null
Initializes and starts the heartbeat service on the worker's timer to begin sending periodic event messages.
Parameters
| Name | Type | Description |
|---|---|---|
| c | celery.worker.Consumer | The consumer instance providing the timer and event dispatcher required for heartbeat execution. |
Returns
| Type | Description |
|---|---|
null | Nothing is returned. |
stop()
@classmethod
def stop(
c: celery.worker.Consumer
) - > null
Stops the heartbeat service and cleans up the reference on the consumer instance.
Parameters
| Name | Type | Description |
|---|---|---|
| c | celery.worker.Consumer | The consumer instance whose heartbeat service should be terminated. |
Returns
| Type | Description |
|---|---|
null | Nothing is returned. |