encode / broadcaster

Broadcast channels for async web apps. 📢
BSD 3-Clause "New" or "Revised" License
1.13k stars 121 forks source link

Fix/22 #64

Open pwoolvett opened 2 years ago

pwoolvett commented 2 years ago

fixes #22 fixes #42

skyforeverRivian commented 6 months ago

recently, my project facing some issue

File "*****/python3.9/site-packages/broadcaster/_base.py", line 62, in connect
    await self._backend.connect()
AttributeError: 'Broadcast' object has no attribute '_backend'

seems like this PR doesn't resolve slow backend initialization issue

logankaser commented 5 months ago

Why didn't this merge? If I fixed its conflicts, would it be accepted?

alex-oleshkevich commented 5 months ago

@logankaser let's have it split into multiple PRs. I believe there is only one issue related to postgres left.

logankaser commented 5 months ago

I think there are two:

  1. This issue, the connection is not guarded by a lock, so it can be accessed while the connection is active. Can be with using a asyncio lock like this PR did, or better something like https://github.com/permitio/broadcaster/blob/master/broadcaster/_backends/postgres.py
  2. 66 Postgres backend cannot gracefully handle connection loss

alex-oleshkevich commented 5 months ago

https://github.com/encode/broadcaster/pull/66 looks like a good merge candidate, but I did not test it yet.

Trinkes commented 3 months ago

Any update on this issue? I'm particularly interested in #22 fix 🙏 .