Skip to content

Commit d9b9084

Browse files
authored
Update http_kernel.rst
1 parent c489d88 commit d9b9084

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

components/http_kernel.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,17 @@ at the moment the exception was thrown.
580580

581581
.. _http-kernel-creating-listener:
582582

583+
10) Resetting the state of request/response flow
584+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
585+
586+
PHP is designed to be stateless, there are no shared resources across different
587+
requests. However, with some specific Runtime (ie FrankenPHP in worker mode), the
588+
kernel can handle multiple request/response, and so you need to take care of cleaning
589+
some services state to not leak memory if needed.
590+
591+
To do so, your service must implement the :class:`Symfony\\Contracts\\Service\\ResetInterface`
592+
where you can reset the properties in the ``reset()`` method.
593+
583594
Creating an Event Listener
584595
--------------------------
585596

0 commit comments

Comments
 (0)