8000 feature #26685 [Messenger] Add a `MessageHandlerInterface` (multiple … · symfony/framework-bundle@d312102 · GitHub
[go: up one dir, main page]

Skip to content

Commit d312102

Browse files
committed
feature #26685 [Messenger] Add a MessageHandlerInterface (multiple messages + auto-configuration) (sroze)
This PR was squashed before being merged into the 4.1-dev branch (closes #26685). Discussion ---------- [Messenger] Add a `MessageHandlerInterface` (multiple messages + auto-configuration) | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | ø | License | MIT | Doc PR | ø Based on @chalasr's PR: symfony/symfony#26672. This reduces the hassle of registering handlers: it allows the auto-configuration with a new interface `HandlerInterface`. At the same time, it allows a handler to handle multiple messages. Commits ------- 07e6bc73a3 [Messenger] Add a `MessageHandlerInterface` (multiple messages + auto-configuration)
2 parents bfca8e6 + 20f149e commit d312102

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
use Symfony\Component\Lock\LockInterface;
6161
use Symfony\Component\Lock\Store\StoreFactory;
6262
use Symfony\Component\Lock\StoreInterface;
63+
use Symfony\Component\Messenger\Handler\MessageHandlerInterface;
6364
use Symfony\Component\Messenger\Transport\ReceiverInterface;
6465
use Symfony\Component\Messenger\Transport\SenderInterface;
6566
use Symfony\Component\PropertyAccess\PropertyAccessor;
@@ -347,6 +348,8 @@ public function load(array $configs, ContainerBuilder $container)
347348
->addTag('messenger.receiver');
348349
$container->registerForAutoconfiguration(SenderInterface::class)
349350
->addTag('messenger.sender');
351+
$container->registerForAutoconfiguration(MessageHandlerInterface::class)
352+
->addTag('messenger.message_handler');
350353

351354
if (!$container->getParameter('kernel.debug')) {
352355
// remove tagged iterator argument for resource checkers

0 commit comments

Comments
 (0)
0