Spec-Zone.ru › Celery

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.

Notes

An event is simply a dictionary: the only required field is type. A timestamp 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.

Parameters:
  • conn (kombu.Connection) – Connection used for sending/receiving events.

  • name (str) – Name of the exchange. Default is celeryev.

Note

The event type changes if Redis is used as the transport (from topic -> fanout).

celery.events.event.group_from(type)

Get the group part of an event type name.

Example

>>> group_from('task-sent')
'task'
>>> group_from('custom-my-event')
'custom'

Copyright © 2017-2026 Asif Saif Uddin, core team & contributors. All rights reserved.
Celery is licensed under The BSD License (3 Clause, also known as the new BSD license). The license is an OSI approved Open Source license and is GPL-compatible.
https://docs.celeryq.dev/en/stable/reference/celery.events.event.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API