[Async-sig] [python-tulip] asyncio.Lock equivalent for multiple processes
gmludo at gmail.com
Tue Apr 17 06:01:21 EDT 2018
Thanks for the pointer, it's exactly the type of feedbacks I'm looking for:
Ideas that are out-of-box of my confort zone.
However, in our use case, we are using gunicorn, that uses forks instead of
multiprocessing to my knowledge, I can't use multiprocessing without to
If somebody is using aioredlock in his project, I'm interested by feedbacks.
Have a nice week.
Ludovic Gasc (GMLudo)
2018-04-17 7:19 GMT+02:00 Roberto Martínez <robertomartinezp at gmail.com>:
> I don't know if there is a third party solution for this.
> I think the closest you can get today using the standard library is using
> a multiprocessing.manager().Lock (which can be shared among processes) and
> call the lock.acquire() function with asyncio.run_in_executor(), using a
> ThreadedPoolExecutor to avoid blocking the asyncio event loop.
> Best regards,
> El mar., 17 abr. 2018 a las 0:05, Ludovic Gasc (<gmludo at gmail.com>)
>> I'm looking for a equivalent of asyncio.Lock (https://docs.python.org/3/
>> library/asyncio-sync.html#asyncio.Lock) but shared between several
>> processes on the same server, because I'm migrating a daemon from
>> mono-worker to multi-worker pattern.
>> For now, the closest solution in term of API seems aioredlock:
>> But I'm not a big fan to use polling nor with a timeout because the lock
>> I need is very critical, I prefer to block the code than unlock with
>> Do I miss a new awesome library or do you have an easier approach ?
>> Thanks for your responses.
>> Ludovic Gasc (GMLudo)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Async-sig