Skip to content

some tweaks for the Messenger component docs #9771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2018
Merged
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions components/messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Concepts
Bus
---

The bus is used to dispatch messages. The behaviour of the bus is in its ordered
The bus is used to dispatch messages. The behavior of the bus is in its ordered
middleware stack. The component comes with a set of middleware that you can use.

When using the message bus with Symfony's FrameworkBundle, the following middleware
Expand All @@ -63,9 +63,9 @@ Example::

$result = $bus->dispatch(new MyMessage(/* ... */));

.. note:
.. note::

Every middleware needs to implement the ``MiddlewareInterface`` interface.
Every middleware needs to implement the ``MiddlewareInterface``.

Handlers
--------
Expand All @@ -89,16 +89,16 @@ that will do the required processing for your message::
Transports
----------

In order to send and receive messages, you will have to configure a transport. An
transport will be responsible of communicating with your message broker or 3rd parties.
In order to send and receive messages, you will have to configure a transport. A
transport will be responsible for communicating with your message broker or 3rd parties.

Your own sender
Your own Sender
~~~~~~~~~~~~~~~

Using the ``SenderInterface``, you can easily create your own message sender.
Let's say you already have an ``ImportantAction`` message going through the
message bus and handled by a handler. Now, you also want to send this message as
an email.
Imagine that you already have an ``ImportantAction`` message going through the
message bus and being handled by a handler. Now, you also want to send this
message as an email.

First, create your sender::

Expand Down Expand Up @@ -135,13 +135,13 @@ First, create your sender::
}
}

Your own receiver
Your own Receiver
~~~~~~~~~~~~~~~~~

A receiver is responsible for receiving messages from a source and dispatching
them to the application.

Let's say you already processed some "orders" in your application using a
Imagine you already processed some "orders" in your application using a
``NewOrder`` message. Now you want to integrate with a 3rd party or a legacy
application but you can't use an API and need to use a shared CSV file with new
orders.
Expand Down Expand Up @@ -183,10 +183,10 @@ First, create your receiver::
}
}

Receiver and Sender on the same bus
Receiver and Sender on the same Bus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To allow us to receive and send messages on the same bus and prevent an infinite
To allow sending and receiving messages on the same bus and prevent an infinite
loop, the message bus is equipped with the ``WrapIntoReceivedMessage`` middleware.
It will wrap the received messages into ``ReceivedMessage`` objects and the
``SendMessageMiddleware`` middleware will know it should not route these
Expand Down
Loading