Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions components/http_kernel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,17 @@ at the moment the exception was thrown.

.. _http-kernel-creating-listener:

10) Resetting the state of request/response flow
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

PHP is designed to be stateless, there are no shared resources across different
requests. However, with some specific Runtime (ie FrankenPHP in worker mode), the
kernel can handle multiple request/response, and so you need to take care of cleaning
some services state to not leak memory if needed.

To do so, your service must implement the :class:`Symfony\\Contracts\\Service\\ResetInterface`
where you can reset the properties in the ``reset()`` method.

Creating an Event Listener
--------------------------

Expand Down