Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control over the spinner when using concurrency #2

Closed
mwgamble opened this issue Jul 22, 2016 · 3 comments
Closed

Control over the spinner when using concurrency #2

mwgamble opened this issue Jul 22, 2016 · 3 comments

Comments

@mwgamble
Copy link

It would be nice to have some level of control over the spinner that is displayed when using concurrency. For example, I would like to be able to have it re-render the spinner only once every 1-2 seconds, rather than constantly.

xolox added a commit to xolox/python-humanfriendly that referenced this issue Mar 2, 2020
The work on spinners was prompted by the following:
xolox/python-executor#2

Everything else was me going mad on a refactoring spree 😇
@mwgamble
Copy link
Author

Just wanted to acknowledge your ongoing commitment to the quality of your software. I truly appreciate you caring about such an old issue and look forward to the point where executor is updated accordingly to match the humanfriendly updates <3

@xolox
Copy link
Owner

xolox commented May 14, 2020

Hi Matthew, first of all thanks for the feedback. Second, sorry it took me so long to get back to this! I've just released executor 23.1 which enables fine grained control over the spinner shown by command pools. Here's a silly example I used to confirm that it works as intended, this assumes Python 3:

from executor import ExternalCommand
from executor.concurrent import CommandPool
from humanfriendly.terminal.spinners import Spinner

pool = CommandPool(spinner=Spinner(glyphs=['◐', '◓', '◑', '◒'], interval=0.5))
pool.add(ExternalCommand('sleep', '20'))
pool.add(ExternalCommand('sleep', '15'))
pool.add(ExternalCommand('sleep', '10'))
pool.run()

I'm going to close this issue now because I think I've adequately implemented your feature request, but if you disagree feel free to reopen this issue or open a new one. Cheers!

@xolox xolox closed this as completed May 14, 2020
@mwgamble
Copy link
Author

No need to apologise :) Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants