JDare / ClankBundle

A Symfony2 Bundle for use with Ratchet WebSocket Server
MIT License
131 stars 31 forks source link

ServerEvent added to provide internal Event Loop #4

Closed jbbrunsveld closed 11 years ago

jbbrunsveld commented 11 years ago

Hi JDare ;)

Thanks for your great efforts to publish and maintain this bundle. It's saves me a lot of time and it has a nice Symfony2 implementation. I tried to make a push integration from the server using a MessageQueuer like Redis. (As Ratchet did in their examples) but I prefere to extend/use the ClankBundle.

In order to run a service in the same eventloop, I think we need a way to expose the eventloop object. I made a ServerEvent triggered by the server launch method. It only contains the loop (but thats enough) so I can add extra services in a separated listener in my own bundles. I made a test with a Redis Pub/Sub client in the listener and it works like a charm.

When you agree with this pull request I'll also make an example in the manual for a push service with a MQer or something similar.

hice3000 commented 11 years ago

:+1:

jbbrunsveld commented 11 years ago

Please, review my enhancement, so we can close this pull request?