File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 11Bridge 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
67Launch 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>`
Original file line number Diff line number Diff line change 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+ );
You can’t perform that action at this time.
0 commit comments