interface MessageSubscriberInterface implements MessageHandlerInterface
Handlers can implement this interface to handle multiple messages.
static iterable | getHandledMessages() Returns a list of messages to be handled. |
Returns a list of messages to be handled.
It returns a list of messages like in the following example:
return [MyMessage::class];
It can also change the priority per classes.
return [
[FirstMessage::class, 0],
[SecondMessage::class, -10],
];
It can also specify a method and/or a priority per message:
return [
FirstMessage::class => 'firstMessageMethod',
SecondMessage::class => ['secondMessageMethod', 20],
];
The __invoke
method of the handler will be called as usual with the message to handle.
iterable |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.html