You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Much of the Python community these days uses async (using asyncio or trio) code. threading.Lock/RLock are suboptimal for async code because they block all concurrent code in an event loop.
It would be nice to:
Support an async-equivalent of Progress
Document the thread-safety (and potential async safety) of Progress in the docs here
What problem does it solve for you?
Efficient asyncio code that uses rich for a progress bar
The text was updated successfully, but these errors were encountered:
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 barThe text was updated successfully, but these errors were encountered: