Tqdm: Asynchronous tqdm

Created on 2 Dec 2015  ·  5Comments  ·  Source: tqdm/tqdm

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.

c8-hard 🕗 p3-enhancement 🔥 submodule ⊂ synchronisation ⇶ to-review 🔍

Most helpful comment

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:

All 5 comments

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 :)

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:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

casperdcl picture casperdcl  ·  5Comments

CrazyPython picture CrazyPython  ·  5Comments

Haffi112 picture Haffi112  ·  5Comments

yarikoptic picture yarikoptic  ·  3Comments

schwobr picture schwobr  ·  5Comments