Nextdoor / ndscheduler

A flexible python library for building your own cron-like system, with REST APIs and a Web UI.
BSD 2-Clause "Simplified" License
1.09k stars 201 forks source link

Make registration of SIGINT handler optional #23

Open bkline opened 7 years ago

bkline commented 7 years ago

There are environments in which it is undesirable to register a handler for the SIGINT signal (for example, when running under a service manager framework which runs the scheduler in a thread other than the primary thread). It is possible to bypass this registration by overriding SchedulerServer.run() but that approach has its own drawbacks. Better would be to either accept an optional keyword argument to run() to suppress the call to signal.signal or (possibly more elegant) support a flag in the settings dictionary. What do you think?

bkline commented 6 years ago

The comments for issue #22 lead me to think that adding an optional keyword argument to SchedulerServer.run() would be preferable to using the settings dictionary in the view of the project maintainers. Do you agree? Have any preferences for the argument's name?