uecode/daemon-bundle — pull request #13 by therealmikz (2014-01-08 15:58:27+00:00)
Title: Enable ReactPHP Support

I needed to use Ratchet (cboden/Ratchet) and react-amqp (jcook/react-amqp) along with daemon-bundle. Both of those libraries use great tool called ReactPHP (http://reactphp.org/) - it's non-blocking I/O in PHP.
It was impossible because daemon-bundle was using locking while loop, so React couldn't work with its event loops.

I've added new class ReactCommand that extends AbstractCommand (AbstractCommand contains most of old ExtendCommand code). I also left old ExtendCommand compatible with previous version so all of daemons written regular way should work without problems (no react needed for them to work).

To use new features, you need to extend ReactCommand instead of ExtendCommand and declare prepareLoop(React\EventLoop\LoopInterface $loop) method that creates daemon logic as periodicTimer in event loop.

Feel free to contact me if you have any questions, I'll watch this PR for new comments.