Skip to content

Commit 2109a58

Browse files
Fill symfony/messenger bridge documentation (#146)
* Fill symfony/messenger bridge documentation * Apply suggestions from code review Co-authored-by: Maximilien Delangle <[email protected]> --------- Co-authored-by: Maximilien Delangle <[email protected]>
1 parent d16d07c commit 2109a58

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

docs/docs/bridges/symfony-messenger.rst

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
Bridge with ``symfony/messenger``
22
============================================================
33

4-
The ``Messenger`` component for ``Symfony`` allows dispatch messages through a bus.
4+
Refer to the `official documentation <https://symfony.com/doc/current/messenger.html>`__ on Symfony's website.
5+
56

67
Launch Job through Messenger dispatcher
78
------------------------------------------------------------
@@ -38,3 +39,18 @@ You will end with something like:
3839
3940
.. seealso::
4041
| :doc:`What is a job launcher? </core-concepts/job-launcher>`
42+
| :doc:`Getting started with Symfony Framework </getting-started/with-symfony>`
43+
| :doc:`Bridge with Symfony Framework </bridges/symfony-framework>`
44+
45+
46+
Dispatch item with messenger writer
47+
------------------------------------------------------------
48+
49+
| This item writer will dispatches each item through Symfony's messenger bus.
50+
| Items must be objects that messenger can handle.
51+
52+
.. literalinclude:: symfony-messenger/dispatch-each-item-as-message-writer.php
53+
:language: php
54+
55+
.. seealso::
56+
| :doc:`What is an item writer? </core-concepts/item-job/item-writer>`
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
use Symfony\Component\Messenger\MessageBusInterface;
6+
use Yokai\Batch\Bridge\Symfony\Messenger\Writer\DispatchEachItemAsMessageWriter;
7+
8+
/** @var MessageBusInterface $messageBus */
9+
10+
new DispatchEachItemAsMessageWriter(
11+
messageBus: $messageBus,
12+
);

0 commit comments

Comments
 (0)