James Tucker
2007-Nov-09 14:03 UTC
[Eventmachine-talk] EventMachine::run - How can I ensure that this
Friends, I am writing an event system which has an interface on a web site which can create events. The creation of events opens up EventMachine::run and connects to the event server, and sends messages. The problem comes if this is run inside of say, event driven mongrel, where it will crash fatally, the same as: EventMachine::run { EventMachine::run { } } The only solution that doesn''t involve heavy monkey patching (load scripts for the evented mongrel patching into the EventMachine module :-/), is to look through caller(), as far as I can tell. EventMachine::running? maybe. It could be really useful for building tests on top of EventMachine units too (for which I''ve done heavy mocking today). Thanks, James.
Jason Roelofs
2007-Nov-09 17:11 UTC
[Eventmachine-talk] EventMachine::run - How can I ensure that
On Nov 9, 2007 5:03 PM, James Tucker <jftucker at gmail.com> wrote:> Friends, > > I am writing an event system which has an interface on a web site which > can create events. > > The creation of events opens up EventMachine::run and connects to the > event server, and sends messages. > > The problem comes if this is run inside of say, event driven mongrel, > where it will crash fatally, the same as: > EventMachine::run { EventMachine::run { } } > > The only solution that doesn''t involve heavy monkey patching (load scripts > for the evented mongrel patching into the EventMachine module :-/), is to > look through caller(), as far as I can tell. > > EventMachine::running? maybe. > > It could be really useful for building tests on top of EventMachine units > too (for which I''ve done heavy mocking today). > > Thanks, > > James. > _______________________________________________ > Eventmachine-talk mailing list > Eventmachine-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/eventmachine-talk >Get the latest from subversion, there now exists EM::reactor_running? Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/eventmachine-talk/attachments/20071109/8f88edf8/attachment.html