Closed lyrixx closed 4 years ago
kernel.reset
is a symfony event we can't rely on in a standalone library.
IMO, the only thing we could do is creating a new processor in charge of dispatching this event when a message have been consumed. This way, for people using the bundle, they'll be able to stop using some of our actual processors (like Doctrine and... that's all!) in favor of the new one.
Do you think it's relevant to do this?
This is a good idea :) Let's do it. Would you mind to create a PR?
Oh no, please do it, it's your idea, I definitively don't want to stole it! :)
Here we go: https://github.com/symfony/symfony/pull/32418
First step done, good job. :) You only have to create a new Processor in Swarrot & update the bundle in order to use it. :)
Thanks for your job! :heart:
Symfony propose a https://github.com/symfony/contracts/blob/master/Service/ResetInterface.php I think we could leverage this interface.
I'm thinking about doctrine and monolog.
For exemple, in monolog bundle, we clear eveything on kernel.reset. Doctrine does the same BTW.
So I think we need to add a dependency on the event dispatcher to be able to dispatch a kernel.reset event after each consumed message.
Thanks to that, we could depreciate some Processors :)
WDYT?