Skip to content

Commit

Permalink
[Messenger] Add example of handler autoconfiguration with attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
Th3Mouk committed Aug 26, 2021
1 parent 8f83b9e commit d4f08a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions messenger/multiple_buses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ you can determine the message bus based on an implemented interface:
->tag('messenger.message_handler', ['bus' => 'query.bus']);
};
.. code-block:: php-attributes
// src/MessageHandler/CommandHandlerInterface.php
namespace App\MessageHandler;
use Symfony\Component\DependencyInjection\Attribute\Autoconfigure;
#[Autoconfigure(tags: [['name' => 'messenger.message_handler', 'bus' => 'command.bus']])]
interface CommandHandlerInterface
{
}
Debugging the Buses
-------------------

Expand Down

0 comments on commit d4f08a1

Please sign in to comment.