events.event

Creating events, and event exchange definition.

Module Contents

Functions

Event(type,_fields=None,__dict__=dict,__now__=None,**fields) Create an event.
group_from(type) Get the group part of an event type name.
get_exchange(conn) Get exchange used for sending events.
Event(type, _fields=None, __dict__=dict, __now__=None, **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.
group_from(type)

Get the group part of an event type name.

Example:
>>> group_from('task-sent')
'task'
>>> group_from('custom-my-event')
'custom'
get_exchange(conn)

Get exchange used for sending events.

Arguments:
conn (kombu.Connection): Connection used for sending/receving events.
Note:
The event type changes if Redis is used as the transport (from topic -> fanout).