MCPcopy
hub / github.com/celery/celery / Event

Function Event

celery/events/event.py:18–30  ·  view source on GitHub ↗

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.

(type, _fields=None, __dict__=dict, __now__=time.time, **fields)

Source from the content-addressed store, hash-verified

16
17
18def Event(type, _fields=None, __dict__=dict, __now__=time.time, **fields):
19 """Create an event.
20
21 Notes:
22 An event is simply a dictionary: the only required field is ``type``.
23 A ``timestamp`` field will be set to the current time if not provided.
24 """
25 event = __dict__(_fields, **fields) if _fields else fields
26 if 'timestamp' not in event:
27 event.update(timestamp=__now__(), type=type)
28 else:
29 event['type'] = type
30 return event
31
32
33def group_from(type):

Callers 13

test_EventFunction · 0.90
setupMethod · 0.90
setupMethod · 0.90
setupMethod · 0.90
QTEVFunction · 0.90
setupMethod · 0.90
__init__Method · 0.90
_eventMethod · 0.90
test_stop_pidbox_nodeMethod · 0.85
__init__Method · 0.85
__init__Method · 0.85
publishMethod · 0.85

Calls 1

updateMethod · 0.45

Tested by 7

test_EventFunction · 0.72
setupMethod · 0.72
setupMethod · 0.72
setupMethod · 0.72
QTEVFunction · 0.72
setupMethod · 0.72
test_stop_pidbox_nodeMethod · 0.68