Skip to main content

Heart

Bootstep sending event heartbeats.

Attributes​

AttributeTypeDescription
requirestuple = (Events,)A tuple containing the bootstep classes that must be initialized before this heart service can start, specifically requiring the Events step.
shutdowncallable = stopAn 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​

NameTypeDescription
cAnyThe consumer or parent object context.
without_heartbeatboolean = FalseFlag to disable the heartbeat service.
heartbeat_intervalfloat = NoneThe interval in seconds between heartbeat messages.
**kwargsdictAdditional 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​

NameTypeDescription
ccelery.worker.ConsumerThe consumer instance providing the timer and event dispatcher required for heartbeat execution.

Returns​

TypeDescription
nullNothing 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​

NameTypeDescription
ccelery.worker.ConsumerThe consumer instance whose heartbeat service should be terminated.

Returns​

TypeDescription
nullNothing is returned.