Skip to content

Commit f52923b

Browse files
committed
minor #12260 Move some doc contents in a Messenger article (javiereguiluz)
This PR was squashed before being merged into the 4.3 branch (closes #12260). Discussion ---------- Move some doc contents in a Messenger article This continues #11827. All credit goes to @noniagriconomie. Commits ------- 9707b69 Move some doc contents in a Messenger article
2 parents 2d7cd2b + 9707b69 commit f52923b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

messenger/handler_results.rst

+4-7
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ You can use this to get the value returned by the handler(s)::
2020
// or get info about all of handlers
2121
$handledStamps = $envelope->all(HandledStamp::class);
2222

23-
A :class:`Symfony\\Component\\Messenger\\HandleTrait` also exists in order to ease
24-
leveraging a Messenger bus for synchronous needs.
25-
The :method:`Symfony\\Component\\Messenger\\HandleTrait::handle` method ensures
26-
there is exactly one handler registered and returns its result.
27-
2823
Working with Command & Query Buses
2924
----------------------------------
3025

@@ -36,8 +31,10 @@ buses are central pieces of the application. Read Martin Fowler's
3631
As queries are usually synchronous and expected to be handled once,
3732
getting the result from the handler is a common need.
3833

39-
To avoid boilerplate code, you can leverage the ``HandleTrait`` in any class
40-
that has a ``$messageBus`` property::
34+
A :class:`Symfony\\Component\\Messenger\\HandleTrait` exists to get the result
35+
of the handler when processing synchronously. It also ensures that exactly one
36+
handler is registered. The ``HandleTrait`` can be used in any class that has a
37+
``$messageBus`` property::
4138

4239
// src/Action/ListItems.php
4340
namespace App\Action;

0 commit comments

Comments
 (0)