[Async-sig] correct way to combine two coroutines in a loop

2021-07-13 Thread Sven R. Kunze
Hey everyone, I hope this is the right mlist to post my question to. If not, please redirect me to the correct one. I recently tried async for websockets. Here's the question: Looking at the following code, is there a better way to do it? I personally find it much too much code for its purp

[Async-sig] Anyone want to take ownership of this mailing list?

2021-07-13 Thread Brett Cannon
Cory and I are the owners and neither of us are that active in this space, so it would probably be best if someone else took over. ___ Async-sig mailing list -- async-sig@python.org To unsubscribe send an email to async-sig-le...@python.org https://mail.p

[Async-sig] Re: Anyone want to take ownership of this mailing list?

2021-07-13 Thread Ethan Furman
On 7/13/21 12:06 PM, Brett Cannon wrote: > Cory and I are the owners and neither of us are that active in this space, so it would > probably be best if someone else took over. I can do it. I'm going for the most mailing lists owner/moderator badge. ;-) -- ~Ethan~

[Async-sig] Re: correct way to combine two coroutines in a loop

2021-07-13 Thread Guido van Rossum
Why not have two independent coroutines that each loop forever, handling events from their respective queues? On Tue, Jul 13, 2021 at 12:04 PM Sven R. Kunze wrote: > Hey everyone, > > I hope this is the right mlist to post my question to. If not, please > redirect me to the correct one. I recent

[Async-sig] Re: correct way to combine two coroutines in a loop

2021-07-13 Thread Dima Tisnek
There's no interdependency in your code snippet. If that's really the case, then why not refactor it into something like: async def notify_all(): async for x in queue: await handle_notification(x) async def receive_all(): async for x in receive: await handle_reception(x)