MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / publish

Method publish

uncommon_route/events.py:34–45  ·  view source on GitHub ↗

Non-blocking fan-out. Safe to call from any async context.

(self, event: dict[str, Any])

Source from the content-addressed store, hash-verified

32 self._subscribers.discard(queue)
33
34 def publish(self, event: dict[str, Any]) -> None:
35 """Non-blocking fan-out. Safe to call from any async context."""
36 for queue in list(self._subscribers):
37 try:
38 queue.put_nowait(event)
39 except asyncio.QueueFull:
40 try:
41 queue.put_nowait({"type": "dropped", "reason": "queue_full"})
42 except asyncio.QueueFull:
43 pass
44 except Exception:
45 log.exception("event publish failed")
46
47 @property
48 def subscriber_count(self) -> int:

Callers 3

handle_feedbackFunction · 0.80
_handle_chat_coreFunction · 0.80
_record_route_traceFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected