[Python-ideas] Re: Barrier Object in asyncio lib

2021-05-10 Thread Emmanuel Arias
Hello! If anyone didn't note, there's a PR about this topic :) https://github.com/python/cpython/pull/24903 Cheers! ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org

[Python-ideas] Re: Barrier Object in asyncio lib

2021-03-01 Thread Yves Duprat
thank you for this explanation Issue on bpo is just created. A PR will coming soon Yves Le 26/02/2021 à 23:19, Guido van Rossum a écrit : On Fri, Feb 26, 2021 at 10:09 AM Yves Duprat

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Paul Bryan
Sorry, didn't see Jonathan's example. On Sat, 2021-02-27 at 01:12 +, Paul Bryan wrote: > Could somone provide a concrete example on a proposed use of such an > asyncio.Barrier? > > On Fri, 2021-02-26 at 14:19 -0800, Guido van Rossum wrote: > > On Fri, Feb 26, 2021 at 10:09 AM Yves Duprat >

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Paul Bryan
Could somone provide a concrete example on a proposed use of such an asyncio.Barrier? On Fri, 2021-02-26 at 14:19 -0800, Guido van Rossum wrote: > On Fri, Feb 26, 2021 at 10:09 AM Yves Duprat > wrote: > > I was expecting an explanation about the initial request. > > Is there an oversight (??)

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Guido van Rossum
On Fri, Feb 26, 2021 at 10:09 AM Yves Duprat wrote: > I was expecting an explanation about the initial request. > Is there an oversight (??) or an another reason to not have a Barrier > primitive in asyncio ? > Probably because nobody working on asyncio at the time had any experience using

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Yves Duprat
I was expecting an explanation about the initial request. Is there an oversight (??) or an another reason to not have a Barrier primitive in asyncio ? @jonathan: as proposed, I will fill an issue on bugs.python.org. Thank you Jonathan and Barry for the discussion

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Jonathan Slenders
>> Why would you need locks for async? Is it to sync with things outside of the async process? `asyncio.Lock` is needed to lock across async operations. (If there is an `await` in the body for the lock). Le ven. 26 févr. 2021 à 10:45, Barry Scott a écrit : > > > On 26 Feb 2021, at 08:31,

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Barry Scott
> On 26 Feb 2021, at 08:31, Jonathan Slenders wrote: > > Barry, > > What you describe sounds like `asyncio.gather(...)` if I understand correctly. > > The thing with a Barier is that it's usable in situations where we don't know > the other tasks. Maybe there is no reference to them from

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-26 Thread Jonathan Slenders
Barry, What you describe sounds like `asyncio.gather(...)` if I understand correctly. The thing with a Barier is that it's usable in situations where we don't know the other tasks. Maybe there is no reference to them from the current scope. Maybe they are even not yet created. It certainly can

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-25 Thread Barry Scott
> On 25 Feb 2021, at 17:15, Jonathan Slenders wrote: > > It does make sense to have a barrier synchronization primitive for asyncio. > The idea is to make a coroutine block until at least X coroutines are waiting > to enter the barrier. > This is very useful, if certain actions need to be

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-25 Thread Yves Duprat
Hi Jonathan Le 25/02/2021 à 18:15, Jonathan Slenders a écrit : It does make sense to have a barrier synchronization primitive for asyncio. The idea is to make a coroutine block until at least X coroutines are

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-25 Thread Jonathan Slenders
It does make sense to have a barrier synchronization primitive for asyncio. The idea is to make a coroutine block until at least X coroutines are waiting to enter the barrier. This is very useful, if certain actions need to be synchronized. Recently, I had to implement a barier myself for our use

[Python-ideas] Re: Barrier Object in asyncio lib

2021-02-25 Thread Barry Scott
> On 25 Feb 2021, at 13:14, Yves Duprat wrote: > > Hi,the list, > > I'm wondering why Barrier object does not exist in the synchronization > primitives of the asyncio lib while it is present in threading and > multiprocessing libs ? > This may not be the right place to ask this question,