mirror of
https://github.com/storytold/EventCenterPlugin.git
synced 2026-10-09 00:09:42 +00:00
This was quite a fight; at least it compiles now... (no idea if works)
Ugh, the type system in C++ is bad. It's hard to fit these things together. I'll have a ton of cleanup to do when done.
This commit is contained in:
@@ -76,7 +76,7 @@ async def server(websocket, path):
|
||||
#await websocket.send("Got message: {}".format(msg))
|
||||
|
||||
print('enqueuing websocket message', flush=True)
|
||||
queue.put_nowait(msg)
|
||||
queue.put_nowait("{}|{}".format(channel, msg))
|
||||
|
||||
asyncio.ensure_future(reader(mpsc))
|
||||
|
||||
@@ -98,7 +98,7 @@ async def server(websocket, path):
|
||||
await websocket.send("Websocket ping")
|
||||
|
||||
if not queue.empty():
|
||||
msg = queue.get_nowait() # TODO THROWS EXCEPTION
|
||||
msg = queue.get_nowait() # TODO THROWS EXCEPTION IF EMPTY (data race?)
|
||||
|
||||
print('sending pubsub msg over websocket: {}'.format(msg), flush=True)
|
||||
await websocket.send(msg)
|
||||
|
||||
Reference in New Issue
Block a user