celluloid/celluloid — pull request #284 by schmurfy (2013-06-18 08:13:34+00:00)
Title: added monitoring interface

Here is something to start the discussions, it enables this: https://gist.github.com/schmurfy/5803479

It is meant as a start not something to be merge as is, when we agree on how something like this can be merge we can maybe add events and change the logic (queue) but until then there is now point doing this.

What I did is add a way to trigger events from specific point in the codebase, by default a stub is loaded with empty methods so nothing is done (can JRuby optimize them out ?) but if your require the monitoring interface then you can plug into it and will receive all the events (see the gist).

The first thing to settle is:
- is doing it this way transparent enough to ensure minimal impact on performance if you don't want the monitoring
interface ? (I would really hate having a global variable controlling this, pretty horrible)

And for the rest:
- are there any other events which would be useful ?
- should this supports more than one client ? This feels overkill for me but I am curious about what you think.

I think the code inside celluloid should only provide the mean to do something more and stay the smallest possible.