airbnb/nerve — pull request #22 by igor47 (2013-10-31 18:12:15+00:00)
Title: allow a no-watchers state

in order to support the use case of dynamic registration, nerve should continue
running even if it was started with no services defined in it's config. this
re-structures the main thread to make that possible.

the main action of the main thread is to sleep, waiting for an interrupt. an
interrupt triggers the reaping of existing watchers, of which there may be
none.

as a byproduct, we create an interface to add additional watchers dynamically.
a hypothetical future TCP server can call `launch_watcher` on the main class to
register a new watcher. similarly, it can call `reap_watcher` to kill a watcher.

@brndnmtthws maybe this could be the basis of your new API?
this is not yet tested. working on additional tests around exiting/signal handling in smartstack-cookbook