From Python 3.4, the stdlib provides an asynchronous decorator. Maybe this can be used to make tqdm asynchronous, thus lowering even further the overhead?
Eg,
try:
from asyncio import coroutine
except ImportError:
def coroutine(func):
return func
From the excellent ipy_progressbar module.
Also, it's interesting to note that they used a deque(maxlen=100) to memorize all 100 previous delta_t to compute their eta. This is I think quite efficient (but not as efficient as us), and it can be a useful trick for us if we want to implement more complex etas.
PS: I do not intend this idea to be implemented anytime soon, but I thought it was a good idea to post it here for the future, I'm pretty sure this will be useful at some point :)
I actually implement a queue in the gui version, I think ;)
async would be cool, but idk if that's a tqdm issue or a general python one
I think tqdm should support asynchronous calls if the user wants it to, but of course this should not be the only way to call tqdm. So maybe a subclass tqdm_async.py could be done :)
Related tutorial here (to develop a unit test) and another good one explaining the history of the PEP here.
PS: I do not intend this idea to be implemented anytime soon, but I thought it was a good idea to post it here for the future, I'm pretty sure this will be useful at some point :)
A few years later and asyncio seems firmly established in Python land. I would love to use async tqdm to report progress on a number of asynchronous HTTP requests made. Any chance of reviving #91? :smiley:
Most helpful comment
A few years later and asyncio seems firmly established in Python land. I would love to use async tqdm to report progress on a number of asynchronous HTTP requests made. Any chance of reviving #91? :smiley: