Baldinof / roadrunner-bundle

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

Throw exception when the Kernel does not implement KernelInterface #108

Open shyim opened 1 year ago

shyim commented 1 year ago

It took me some time to understand that your Kernel needs to implement KernelInterface. It would be much easier when you would throw just an exception when the requirements are not met.

Is there some reason why it currently has an fallback?

https://github.com/Baldinof/roadrunner-bundle/blob/2.x/src/Runtime/Runtime.php#L19

Baldinof commented 1 year ago

Hello,

I would accept a PR to throw when RR_MODE is set but the kernel is not app is not a KernelInterface.

How did you land in that case?

shyim commented 1 year ago

We do crazy stuff with Symfony Kernels also wrapping them up 😅 https://github.com/shopware/recipes/blob/main/shopware/core/6.4/public/index.php#L53

I will make later a PR :)

Baldinof commented 1 year ago

Ahah alright, the kernel is only required to retrieve the WorkerRegistryInterface in the runner.

I would also accept something that decouple the runner from the KernelInterface if it can helps.