Skip to content

Allow listening to Abstract events #9

@kpicaza

Description

@kpicaza

Is your feature request related to a problem? Please describe.
At the moment the dispatcher only makes match by exact class coincidence, it would be great to have the ability to listen to abstract classes or interfaces too

Describe the solution you'd like
Instead of checking only for exact class check for parents too

For example, using it with antidot framework starter you need a config like that:

services:
  App\Application\EventListener\QueueLogWriter:
    tags:
      - { name: 'event_listener', event: 'Antidot\Queue\Event\MessageProcessed' }
      - { name: 'event_listener', event: 'Antidot\Queue\Event\MessageReceived' }
      - { name: 'event_listener', event: 'Antidot\Queue\Event\QueueConsumerStarted' }

Listening to parent class it will look like this

services:
  App\Application\EventListener\QueueLogWriter:
    tags:
      - { name: 'event_listener', event: 'Antidot\Queue\Event\QueueEvent' }

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions