MCPcopy Create free account
hub / github.com/appenz/camera-app / sync_callback

Function sync_callback

src/watchdog.py:32–37  ·  view source on GitHub ↗
(msg)

Source from the content-addressed store, hash-verified

30
31def make_sync_callback(loop, async_callback, logger=None):
32 def sync_callback(msg):
33 try:
34 loop.call_soon_threadsafe(asyncio.create_task, async_callback(msg))
35 except Exception as e:
36 if logger:
37 logger.error(f"Failed to schedule callback on event loop: {e}")
38 return sync_callback
39
40class WebsocketWatchdog:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected