MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / _send_async

Function _send_async

core/utils.py:889–905  ·  view source on GitHub ↗

Send a channel layer group message without blocking the gevent hub.

(channel_layer, group, message)

Source from the content-addressed store, hash-verified

887
888
889def _send_async(channel_layer, group, message):
890 """Send a channel layer group message without blocking the gevent hub."""
891 def _do():
892 try:
893 async_to_sync(channel_layer.group_send)(group, message)
894 except Exception as e:
895 logger.warning(f"Failed WebSocket group_send to '{group}': {e}")
896
897 try:
898 import gevent.monkey
899 if gevent.monkey.is_module_patched("threading"):
900 import gevent
901 gevent.spawn(_gevent_ws_send, group, message)
902 return
903 except Exception:
904 pass
905 _do()
906
907
908def send_websocket_notification(notification):

Callers 2

Calls 1

_doFunction · 0.85

Tested by

no test coverage detected