Baldinof / roadrunner-bundle

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

Multitenancy: Kerner-per-Tenant option #63

Open eXsio opened 2 years ago

eXsio commented 2 years ago

Hi

Great stuff here :) one question: would it be possible to add some sort of KernelProvider? By default it would just return the same instance, but it would open up a possibility to have multiple Kernel instances and return a specific Kernel based on an env configuration, or a request param (for example we could have a TenantKernelProvider that would ensuer each Tenant has its own Kernel).

That would also allow to have codnitional services - depending on the Tenant.

Baldinof commented 2 years ago

Hi! Thank you for the kind words :)

I think this could lead to some hard to debug issues, because the Worker will still have been initialized by the original kernel.

What is your use case for having multiple kernel?

eXsio commented 2 years ago

The use case would be to be able to run the same code for different clients. The configuration (like for example DB urls) and the modules/bundles enabled could be different on a per-client basis. I know that I can just create separate instances for Roadrunner for each Client, but I was wondering if this could be somehow addressed by having just one Worker pool.