Equivalent of ResetInterface from Symphony DI #319
Replies: 1 comment
-
From my perspective, this is a 3 step process on Nette side: Introduce a repository with DI contracts, containing the interface (let's call it e.g.
Add support to nette/di:
Add support to all Nette packages:
It seems doable, but the amount of work is huge. I probably missed half the stuff that needs reset in individual packages, extensive testing would be needed, identifying common pitfalls in Nette apps, support in third party packages... ouch. Also for the third party packages it would be nice to notify the mostly used vendors and add some tag to packages that are ready for workers, so everyone does not have to do their own research. This feature is mostly beneficial for high throughput apps in which enabling such feature while blindly believing all packages are ready is just too large risk. |
Beta Was this translation helpful? Give feedback.
-
Hi! I am starting this discussion based on the following short exchange of messages on the Czech Nette Forum:
https://forum.nette.org/cs/36737-fungovani-nette-ve-worker-modelu-kompatibilita
Basically, @mabar explained to me that in order to use Nette Dependency Injection in a worker model, something like ResetInterface would have to be supported. This is likely a lot of work, but perhaps I could contribute with some observations; I already have some experience with partial resets of the DI from my own testing micro-framework based on Nette Tester, where I switch contexts between users rapidly, plus from some experiments with FrankenPHP / Caddy and behavior of Nette under it.
I put together an experimental Docker-based server with FrankenPHP and I can offer it as a sandbox for experiments, too.
Beta Was this translation helpful? Give feedback.
All reactions