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

celery.events.receiver

Event receiver implementation.

class celery.events.receiver.EventReceiver(channel, handlers=None, routing_key='#', node_id=None, app=None, queue_prefix=None, accept=None, queue_ttl=None, queue_expires=None)[source]

Capture events.

Parameters:
  • connection (kombu.Connection) – Connection to the broker.

  • handlers (Mapping[Callable]) – Event handlers. This is a map of event type names and their handlers. The special handler “*” captures all events that don’t have a handler.

app = None
capture(limit=None, timeout=None, wakeup=True)[source]

Open up a consumer capturing events.

This has to run in the main process, and it will never stop unless EventDispatcher.should_stop is set to True, or forced via KeyboardInterrupt or SystemExit.

property connection
event_from_message(body, localize=True, now=<built-in function time>, tzfields=operator.itemgetter('utcoffset', 'timestamp'), adjust_timestamp=<function adjust_timestamp>, CLIENT_CLOCK_SKEW=-1)[source]
get_consumers(Consumer, channel)[source]
itercapture(limit=None, timeout=None, wakeup=True)[source]
on_consume_ready(connection, channel, consumers, wakeup=True, **kwargs)[source]
process(type, event)[source]

Process event by dispatching to configured handler.

wakeup_workers(channel=None)[source]