@@ -38,9 +38,11 @@ Concepts
3838Bus
3939---
4040
41- The bus is used to dispatch messages. MessageBus' behaviour is in its ordered
42- middleware stack. When using the message bus with Symfony's FrameworkBundle, the
43- following middlewares are configured for you:
41+ The bus is used to dispatch messages. The behaviour of the bus is in its ordered
42+ middleware stack. The component comes with a set of middlewares that you can use.
43+
44+ When using the message bus with Symfony's FrameworkBundle, the following middlewares
45+ are configured for you:
4446
4547#. :code: `LoggingMiddleware ` (logs the processing of your messages)
4648#. :code: `SendMessageMiddleware ` (enables asynchronous processing)
@@ -56,11 +58,15 @@ Example::
5658 $bus = new MessageBus([
5759 new HandleMessageMiddleware(new HandlerLocator([
5860 MyMessage::class => $handler,
59- ]))
61+ ])),
6062 ]);
6163
6264 $result = $bus->handle(new MyMessage(/* ... */));
6365
66+ .. note:
67+
68+ Every middleware need to implement the :code:`MiddlewareInterface` interface.
69+
6470 Handlers
6571--------
6672
@@ -87,11 +93,8 @@ Adapters
8793The communication with queuing system or third parties is delegated to
8894libraries for now.
8995
90- Create your adapter
91- ~~~~~~~~~~~~~~~~~~~
92-
9396Your own sender
94- ---------------
97+ ~~~~~~~~~~~~~~~
9598
9699Using the ``SenderInterface ``, you can easily create your own message sender.
97100Let's say you already have an ``ImportantAction `` message going through the
@@ -134,7 +137,7 @@ First, create your sender::
134137 }
135138
136139Your own receiver
137- -----------------
140+ ~~~~~~~~~~~~~~~~~
138141
139142A receiver is responsible for receiving messages from a source and dispatching
140143them to the application.
0 commit comments