Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
270 stars 48 forks source link

Add centrifuge worker prototype #123

Closed FluffyDiscord closed 4 months ago

FluffyDiscord commented 1 year ago

This PR aims to implement support for Centrifuge worker https://roadrunner.dev/docs/plugins-centrifuge using symfony event dispatcher.

As it is, it works, but it should probably receive it's own middleware stack, mainly for doctrine and sentry. I am not sure about it's own kernel_reboots, I guess its also needed?

The centrifugo middleware will need to be separated from http middlewares, probably simply using different namespaces, so we do not touch http middlewares and keep the yaml config. Middlewares would then sort by the interface they implement.

If we do want to add kernel reboots, then we will need to change the yaml config structure, which could be breaking change if we want to make them universal

Baldinof commented 1 year ago

Thank you!

Sorry for the delay, I'll try to have a look this week.

FluffyDiscord commented 1 year ago

Please let me know which things need to be added or adjusted so this PR aligns with this bundle's intentions

FluffyDiscord commented 11 months ago

don't forget also this PR this week so we can have offical support! :]

FluffyDiscord commented 11 months ago

Do you have any suggestions about the middleware structure in the context of websockets? There should definitely be a Doctrine and Sentry middleware - Doctrine to reset the EntityManager and Sentry to send all caught events, just like in the context of HTTP.

I am not sure which would be better, if to add event listener (which could be cancelled by user by mistake) or equivalent of the HTTP stack, but modified to run before and after instead of the current Generator approach (since we are dispatching the websocket message as event)

michaelgracious commented 4 months ago

Is this PR is stalled? This is something i'd love to see in the bundle so we can use Centrifuge

FluffyDiscord commented 4 months ago

Is this PR is stalled? This is something i'd love to see in the bundle so we can use Centrifuge

yes, I won't be adding anything here, I have made my own bundle with centrifuge