This document describes the current stable version of Celery (5.1). For development docs, go here.
Creating events, and event exchange definition.
Event(type, _fields=None, __dict__=<class 'dict'>, __now__=<built-in function time>, **fields)¶
Create an event.
An event is simply a dictionary: the only required field is
timestampfield will be set to the current time if not provided.
event_exchange= <unbound Exchange celeryev(topic)>¶
Exchange used to send events on. Note: Use
get_exchange()instead, as the type of exchange will vary depending on the broker connection.
Get exchange used for sending events.
The event type changes if Redis is used as the transport (from topic -> fanout).
Get the group part of an event type name.
>>> group_from('task-sent') 'task'
>>> group_from('custom-my-event') 'custom'