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

FIX: exit program on ctrl-C #24

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

FIX: exit program on ctrl-C #24

wants to merge 1 commit into from

Conversation

madisonmay
Copy link
Owner

Example to test with:

from tomorrow import threads
from time import sleep

N = 2

# a `timeout` value is required in order to ensure that 
# execution periodically returns to the main thread
@threads(N, timeout=100)
def hanging_thread():
    while True:
        sleep(1)

if __name__ == "__main__":
    results = []
    for i in range(N):
        results.append(hanging_thread())

    for result in results:
        print result

TODO:

  • Add tests
  • Decide whether this behavior is desirable

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.

1 participant