Skip to content

[DependencyInjection] Update kernel.reset explanation #18635

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

Merged

Conversation

alamirault
Copy link
Contributor

Try to fix #16806

Change was done in this PR symfony/symfony#24709

I'm open for better wording 😄

@carsonbot carsonbot added this to the 5.4 milestone Jul 29, 2023
@@ -711,7 +711,7 @@ kernel.reset

**Purpose**: Clean up services between requests

During the ``kernel.terminate`` event, Symfony looks for any service tagged
When it's not the first Request, Symfony looks for any service tagged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a bit hard to understand. What about being a bit more explicit to also mention main/sub requests, etc.

Proposal:

In all main requests (not :ref:`sub-requests <http-kernel-sub-requests>`) except
the first one, Symfony looks for any service tagged with the ``kernel.reset`` tag
to reinitialize their state. This is done by calling to the method whose name is
configured in the ``method`` argument of the tag.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I applied your suggestion 😃 Thanks

@alamirault alamirault requested a review from javiereguiluz July 31, 2023 17:33
@carsonbot carsonbot changed the title Update kernel.reset explanation [DependencyInjection] Update kernel.reset explanation Aug 1, 2023
@javiereguiluz javiereguiluz force-pushed the hotfix/16809-resetable-services branch from c3f1eec to a8803e2 Compare August 1, 2023 06:40
@javiereguiluz
Copy link
Member

Thanks Antoine.

@javiereguiluz javiereguiluz merged commit 207605b into symfony:5.4 Aug 1, 2023
@alamirault alamirault deleted the hotfix/16809-resetable-services branch August 1, 2023 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants