Baldinof / roadrunner-bundle

A RoadRunner worker integrated in your Symfony app
MIT License
255 stars 46 forks source link

Add centrifuge worker prototype #123

Open FluffyDiscord opened 11 months ago

FluffyDiscord commented 11 months 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 11 months ago

Thank you!

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

FluffyDiscord commented 11 months ago

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

FluffyDiscord commented 6 months ago

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

FluffyDiscord commented 6 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)