Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/22 #64

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix/22 #64

wants to merge 4 commits into from

Conversation

pwoolvett
Copy link
Contributor

@pwoolvett pwoolvett commented May 6, 2022

fixes #22
fixes #42

@@ -13,6 +13,8 @@ def __init__(self, url: str):

async def connect(self) -> None:
self._conn = await asyncpg.connect(self._url)
self._event = asyncio.Event()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be simpler to use asyncio.Lock?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simpler, and better.

This fix adds an asyncio.Lock to avoid
`asyncpg.exceptions._base.InterfaceError: cannot perform operation: another operation is in progress`

fixes encode#22
@skyforeverRivian
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants