broadcaster
broadcaster copied to clipboard
Broadcast channels for async web apps. 📢
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....
[Currently](https://github.com/encode/broadcaster/blob/435c35eefcf54192331a44881caf626a5993b2f0/broadcaster/_backends/kafka.py#L31), unsubscribing from one Kafka channel unsubscribes from all channels. Based on the aiokafka [docs](https://aiokafka.readthedocs.io/en/stable/api.html#aiokafka.AIOKafkaConsumer.subscribe) I'm guessing we want to do ```python self._consumer_channels.remove(channel) self._consumer.subscribe(topics=self._consumer_channels) ```
Fix/22
* test: add concurrent checks * group together fixtures for backend testing * Add per-backend setup to allow slow initialization. This is specially important as kafka subscribe can return while...
The exception raised by WebSocket disconnection fails the unsubscribing behavior of the `Subscriber` context manager. Fixed it by moving the unsubscribing snippet to the `finally` block.
Hi I Using broadcaster for websocket connection and set new unique id for websocket client when new websocket connection open and subscribe on this unique id other application publish message...
I think there is logic that I want to determine if it is subscribed and process it. For example, if I don't have any subscribers, I want to discard or...
Google cloud pubsub is widely used, it would be useful to be able to use it as a backend.
Using the testing example from the [Starlette docs](https://www.starlette.io/testclient/#testing-websocket-sessions) with a route that uses a Redis websocket just hangs indefinitely: ```python def test_websocket(client): with client.websocket_connect("/ws") as websocket: websocket.send_text("Hello WebSocket") data =...
We now have tests suite courtesy of #11, but test for Kafka backend hands indefinitely on `await subscriber.get()`, causing tests suite to timeout: https://github.com/encode/broadcaster/blob/435c35eefcf54192331a44881caf626a5993b2f0/tests/test_broadcast.py#L43 Sadly, I'm out of my depth...
Using broadcaster w/ fastapi and seeing an exception when using broadcaster via websockets. Relevant parts: ``` await self._conn.execute("SELECT pg_notify($1, $2);", channel, message) # ... 'cannot perform operation: another operation is...