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

signal.alarm() -> threading.Timer() #11

Merged
merged 5 commits into from
Jul 24, 2019
Merged

signal.alarm() -> threading.Timer() #11

merged 5 commits into from
Jul 24, 2019

Conversation

matroskin8
Copy link
Contributor

This pr fixes #10

@matroskin8
Copy link
Contributor Author

matroskin8 commented Feb 12, 2019

@seemethere
Ok, i see - it's a weird patch. But how about to remove sending signal at all ? %)
How do you think how many seconds lasts this call

from time import sleep

import retry


def foo():
    sleep(5)
    assert False


retry.retry(interval=0, timeout=1)(foo)()

Damn - 45 seconds

I chose retry.it among others, i like it's "success" in arguments. I got addicted to retry.it in my code.. But sigalarm limits me to replace every old home-brew retry-like fragments to retry.it.
Just say do you want to do something - discuss, say NO or so ?

@seemethere seemethere merged commit 7f8ae99 into seemethere:master Jul 24, 2019
@seemethere seemethere mentioned this pull request Jul 29, 2019
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

Successfully merging this pull request may close these issues.

"ValueError: signal only works in main thread"
2 participants