stripe/einhorn — pull request #28 by paulhammond (2013-08-14 21:18:35+00:00)
Title: Wait for upgrades to complete

This pull request implements the [changes suggested by @gdb](https://github.com/stripe/einhorn/pull/14#issuecomment-11325635) in #14. It adds request IDs and a wait response attribute to the protocol, adds optional tags to log lines, and updates the client to allow for multiple responses to a single request. The end result is that an upgrade command now blocks until finished:

$ echo upgrade | bundle exec einhornsh
Upgrading, as commanded
Loading ./example/time_server (if this hangs, make sure your code can be properly loaded as a library)
Successfully loaded ./example/time_server
Starting upgrade from version 0...
Upgrade to version 1 complete.
Upgrade done

The protocol is backwards compatible with older clients - if the new `request_id` attribute is not present on a request then the server assumes that the client is not expecting multiple responses and behaves in the old way.

I have not implemented all of the suggestions - in particular `stream:subscribe` and `stream:unsubscribe` have not been implemented. I've also not changed the `reload` command to use this new functionality. Both of these should be possible with the new code. I've also not added the ability to interrupt a long running command to issue other commands - this should only require changes to the client code.