MCPcopy Create free account
hub / github.com/python-websockets/websockets / publish_event

Function publish_event

example/django/signals.py:11–23  ·  view source on GitHub ↗
(instance, **kwargs)

Source from the content-addressed store, hash-verified

9
10@receiver(post_save, sender=LogEntry)
11def publish_event(instance, **kwargs):
12 event = {
13 "model": instance.content_type.name,
14 "object": instance.object_repr,
15 "message": instance.get_change_message(),
16 "timestamp": instance.action_time.isoformat(),
17 "user": str(instance.user),
18 "content_type_id": instance.content_type_id,
19 "object_id": instance.object_id,
20 }
21 connection = get_redis_connection("default")
22 payload = json.dumps(event)
23 connection.publish("events", payload)

Callers

nothing calls this directly

Calls 1

publishMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…