Skip to content

[Messenger] Add doc for default routing for messages #16720

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
Oct 5, 2022
Merged
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
8 changes: 7 additions & 1 deletion messenger.rst
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ you can configure them to be sent to a transport:

Thanks to this, the ``App\Message\SmsNotification`` will be sent to the ``async``
transport and its handler(s) will *not* be called immediately. Any messages not
matched under ``routing`` will still be handled immediately.
matched under ``routing`` will still be handled immediately, i.e. synchronously.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
matched under ``routing`` will still be handled immediately, i.e. synchronously.
matched under ``routing`` will still be handled immediately (e.g. synchronously).


.. note::

You may use ``'*'`` as the message class. This will act as a default routing
rule for any message not matched under ``routing``. This is useful to ensure
no message is handled synchronously by default.

You can also route classes by their parent class or interface. Or send messages
to multiple transports:
Expand Down