outbrain/propagator — pull request #14 by jearle-dealnews (2014-09-16 04:14:42+00:00)
Title: Add events/hooks to propagator and allow external scripts to listen for those events

At dealnews, we've been using propagator for a little while now and we would like to contribute back. Please review these changes and let us know if you believe that they add value to propagator. If there is anything that we could do differently that you feel better fits with the direction propagator is going, please let us know. We would be happy to make any changes that you might suggest.

Our previous system for deploying database changes would post a message to our developers chat room when someone deployed a change to one of our production databases. With these set of changes, we were hoping to add something to propagator that would allow us to do something similar.

I have added event markers into the propagator code. When the code reaches one of these markers, any scripts that have registered as a listener for that event will be notified of the event. Relevant information about the event will be passed by way of an object so that the external script can log, email, post to chat, etc... whatever information may be desired.

I have updated the documentation (MANUAL.md) with information that describes how to register event listeners and provides a list of events that are currently supported. I have also added a set of unit tests that test the new event handler code.