-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add a shutdown_condition to setup #81
Conversation
|
720362b
to
97f18b3
Compare
Cool, updated so the tests should be passing now |
Hmm, it looks like one test is failing under pypy, but I think it also failed on the last run of master as well: https://travis-ci.org/itamarst/crochet/builds/49051118 |
Yeah, see #73 for issue about that. |
(Haven't had time to look at this in detail yet, but it's on my todo list). |
_watchdog = Watchdog([t for t in threading.enumerate() | ||
if t.name == "MainThread"][0], _registry.run) | ||
register = _registry.register | ||
def default_shutdown_condition(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In retrospect it's not clear to me why this is module-level state at all. Seems like all of the state could live inside EventLoop
, and then there's no need to pass a FunctionRegistry
instance to EventLoop.__init__
, it would just create one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may be forgetting why this was necessary though, so if you think it's too big of a change for you (or this branch) it's not necessary to do this.
Thanks for your contribution! Besides the comments above:
Or, if you feel like you've done enough I'd be happy to take over. |
Cool, thanks for looking it over. I should be able to get back to this in the next few days and make those changes |
It looks like #83 actually fixed uWSGI. So maybe this is overkill lacking a known environment where it's necessary? I can certainly imagine such environments, mind you, just not sure if they exist in practice. |
Yup, I'm happy with #83. I'd be fine closing this, or leaving it around in case it becomes necessary. Either works for me. |
I'll close, we can re-open if it turns out someone needs it. |
Resolves #78
Add a
shutdown_condition
tosetup()
which can be used in environments that don't have a main thread with the expected name (or where you want to shutdown on some other condition).