| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Hi @asafc - this was a good start. |
Sorry, something went wrong.
|
Hi @dariosky, I don't believe automatically reconnecting is a good idea: when connection is loss messages could be missed, On our use case - disconnecting (marked by ending the iterator) is more than enough (then the caller can reconnect). WDYT? |
Sorry, something went wrong.
|
Having an on_reconnect parameter is a good idea - so the caller can handle the eventual gap-filling... |
Sorry, something went wrong.
|
Not sure I understand - have you pushed that fix? (or plan on pushing it?) |
Sorry, something went wrong.
|
I didn't (I asked above if it can be useful) - let me add it here :) |
Sorry, something went wrong.
| await queue.put(event) | ||
|
|
||
| # Ubsubscribe all | ||
| for queue in sum([list(qs) for qs in self._subscribers.values()], []): |
There was a problem hiding this comment.
# Unsubscribe all
for queue_set in self._subscribers.values():
for queue in queue_set:
await queue.put(None)Seems like a lot less wasteful / clear what's going on.
As far as I know, you can loop over sets directly in python, no need
to convert to a list.
Sorry, something went wrong.
|
This requires extra testing. Will not include in 0.3 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This bugfix handle a situation where broadcaster does not detect the Postgres backend terminating the connection.
A user of Broadcaster will not be able to handle disconnects in their code.
i.e: the next loop will not exit:
async def chatroom_ws_sender(websocket): async with broadcast.subscribe(channel="chatroom") as subscriber: async for event in subscriber: await websocket.send_text(event.message)when either: