mozilla-services/circus — pull request #676 by scottkmaxwell (2013-11-22 07:30:21+00:00)
Title: Enhanced reload

Fixed a couple of bugs and made some enhancements.

Bugs
====
* **hooks** was not on the prefix list so could not be set with the `set` command.
* `watcher._reload_stream` was checking for **stdout** instead of **stdout_stream** so setting stdout_stream.* was actually replacing stderr instead.
* if you specified a custom stream class and a filename, the class was ignored and you got a `FileStream` every time.

Enhancements
===========
* When you shutdown circus or when you reloaded a stream, the old stream was never closed. I added code for both cases to see if the object has a 'close' attribute and to call it if so.
* When you reload a hook or a stream class, __import__ was always used, so you could not update the code for either without shutting `circusd` completely down and restarting it. I added reload logic.
* Streams can now be reloaded without restarting the watcher. A new stream is opened, the redirect is replaced with the new stream, then the old stream is closed.
* Watchers are not reloaded when a hook is set.