Skip to content

Commit 91d4a70

Browse files
committed
[Messenger] Add that the same instance of a service will be injected
1 parent 574e467 commit 91d4a70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

messenger.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ you can decide to not take care of services that may leak memory.
707707

708708
On the other hand, workers usually sequentially process messages in long-running CLI processes, which don't
709709
finish after processing a single message. That's why you must be careful about service
710-
states to prevent information and/or memory leakage.
710+
states to prevent information and/or memory leakage as Symfony will inject the same instance of a
711+
service, preserving the internal state of the service between messages.
711712

712713
However, certain Symfony services, such as the Monolog
713714
:ref:`fingers crossed handler <logging-handler-fingers_crossed>`, leak by design.

0 commit comments

Comments
 (0)