Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

Conversation

@hramezani
Copy link
Contributor

No description provided.

await asyncio.sleep(1)

async def next_published(self) -> Event:
await self._wait_for_streams()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I want to wait for at least one stream.
Don't know is it a good approach or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't it work fine without the sleep? It should only stop reading if timeout is specified. I'll check it tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, it's a bit complicated. For instance, we also want to properly cover the case where a new stream is subscribed too, while we're waiting on an existing xread.

Copy link
Contributor

@lovelydinosaur lovelydinosaur left a comment

Choose a reason for hiding this comment

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

Fantastic stuff! Therre's a bit of complexity around how we'll deal with waiting for/issuing/canceling the xread that'll need a bit of thinking over.

I'm wondering if a good precursor to this PR would be to first just implement an aioredis based PUB/SUB implementation. That looks to be more maintained that our existing dependency of asyncio-redis, and since it supports the stream API that asyncio-redis doesn't, it'd be a better default for us.

@hramezani hramezani closed this Feb 26, 2020
@hramezani hramezani reopened this Feb 26, 2020
@hramezani
Copy link
Contributor Author

Sorry I have closed the PR by mistake.
@tomchristie Do you mean to change the current redis backend and use aioredis instead of asyncio-redis? if so, I can take care of it.

@lovelydinosaur
Copy link
Contributor

Do you mean to change the current redis backend and use aioredis instead of asyncio-redis? if so, I can take care of it.

Yup.

(I actually meant adding an aioredis PUB/SUB implementation in addition to the existing asyncio-redis PUB/SUB one, but actually let's just change it over competely, as the simpler option.)

@lostb1t
Copy link

lostb1t commented Oct 29, 2020

Im very interested in this backend. Is there a way to push this forward without forking?

@carltongibson
Copy link

@sarendsen Using your own fork and reporting any issues is a good way forward.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants