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

Lifecycle premature termination if on_startup assigned before every #195

Open
EdNoepel opened this issue Oct 7, 2020 · 0 comments
Open

Comments

@EdNoepel
Copy link
Contributor

EdNoepel commented Oct 7, 2020

If an on_startup handler is assigned the result of a method rather than the method itself, _main_loop will prematurely execute, any_filter_thread_present() or self._at_least_one_every will be False, and the keeper will immediately terminate before the Lifecycle instance has been fully configured.

A better behavior would be to type-check the passed parameter to ensure it is a function, raising a ValueError if something unexpected was passed.

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

1 participant