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:
Brandon Thomas
2021-02-19 05:48:16 -05:00
parent 33a2230323
commit 9c5b8fe57f
5 changed files with 130 additions and 7 deletions
+2 -2
View File
@@ -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)