Open jamesbraza opened 3 days ago
AFAIK there are no issues with using progress in an async app.
The locks are there to synchronize with a thread that performs updates, and other threads launched by the dev. If they block, it is for microseconds, during which the cpu is 100% utilized and the async loop wouldn't be able to switch anyway.
In other words, the way Rich uses threading locks its no less optimal that any code between await
keywords in an async app.
How would you improve Rich?
As of
rich==13.8.1
, it looks likeProgress
centers on athreading.RLock
for thread safety. This is good for multithreading users.Much of the Python community these days uses
async
(usingasyncio
ortrio
) code.threading.Lock
/RLock
are suboptimal forasync
code because they block all concurrent code in an event loop.It would be nice to:
async
-equivalent ofProgress
async
safety) ofProgress
in the docs hereWhat problem does it solve for you?
Efficient
asyncio
code that usesrich
for a progress bar