-
Notifications
You must be signed in to change notification settings - Fork 8
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
How to abort polling ? #12
Comments
Maybe one solution #13 |
Hi @oijkn, sorry for the late reply. I don't think github was setup correctly to send my notifications. Thanks for raising the issue. Yes, you are right, there's no built-in way to abort the polling. That is an interesting idea. I suppose I had just not expected anyone would want to do that. As you can set a However, in this case, if you don't know how long you want to wait, or you want decide you want to stop the polling, then yes, there's no way to do it. And a signal could be the answer. Or at least, adding abort functionality could be useful. |
The thing is, when I'm in the python REPL, if I hit 'control-c' when polling is on-going, the keyboard immediately interupts the polling. > python
Python 3.7.3 (v3.7.3)
Type "help", "copyright", "credits" or "license" for more information.
>>> def checker(x):
... print('time is {0}'.format(x))
... return False # always return false so polling never ends
...
>>> import polling2, time
>>> polling2.poll(time.time, check_success=checker, poll_forever=True, step=1)
time is 1599815583.927871
time is 1599815584.927925
time is 1599815585.9280493
time is 1599815586.9282694
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "polling2\polling2.py", line 215, in poll
time.sleep(step)
KeyboardInterrupt
>>> So I'm not sure I can replicate the issue you are having. |
Hi,
Can you tell me how I can abort, exit, kill, cancel or any other method the poll ?
Because when I use Ctrl+c or stop my script, I wai a long time before I can regain control of the console.
Thank you for this good project and support.
The text was updated successfully, but these errors were encountered: