Skip to content

Commit d4f08a1

Browse files
committed
[Messenger] Add example of handler autoconfiguration with attributes
1 parent 8f83b9e commit d4f08a1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

messenger/multiple_buses.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ you can determine the message bus based on an implemented interface:
223223
->tag('messenger.message_handler', ['bus' => 'query.bus']);
224224
};
225225
226+
.. code-block:: php-attributes
227+
228+
// src/MessageHandler/CommandHandlerInterface.php
229+
namespace App\MessageHandler;
230+
231+
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
232+
233+
#[Autoconfigure(tags: [['name' => 'messenger.message_handler', 'bus' => 'command.bus']])]
234+
interface CommandHandlerInterface
235+
{
236+
}
237+
226238
Debugging the Buses
227239
-------------------
228240

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy