pymaker icon indicating copy to clipboard operation
pymaker copied to clipboard

Lifecycle premature termination if `on_startup` assigned before `every`

Open EdNoepel opened this issue 4 years ago • 0 comments

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.

EdNoepel avatar Oct 07 '20 12:10 EdNoepel