Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage ResetInterface #193

Closed
lyrixx opened this issue Jun 20, 2019 · 5 comments
Closed

Leverage ResetInterface #193

lyrixx opened this issue Jun 20, 2019 · 5 comments

Comments

@lyrixx
Copy link
Contributor

lyrixx commented Jun 20, 2019

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?

@odolbeau
Copy link
Member

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?

@lyrixx
Copy link
Contributor Author

lyrixx commented Jun 27, 2019

This is a good idea :) Let's do it.
Would you mind to create a PR?

@odolbeau
Copy link
Member

Oh no, please do it, it's your idea, I definitively don't want to stole it! :)

@lyrixx
Copy link
Contributor Author

lyrixx commented Jul 8, 2019

Here we go: symfony/symfony#32418

@odolbeau
Copy link
Member

odolbeau commented Jul 8, 2019

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! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants