celery.events.event
¶
Creating events, and event exchange definition.
- celery.events.event.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
type
. Atimestamp
field will be set to the current time if not provided.
- celery.events.event.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.
- celery.events.event.get_exchange(conn, name='celeryev')[源代码]¶
Get exchange used for sending events.
- 参数:
conn (kombu.Connection) -- Connection used for sending/receiving events.
name (str) -- Name of the exchange. Default is
celeryev
.
备注
The event type changes if Redis is used as the transport (from topic -> fanout).