Skip to content

How to deal with command / event busses? #91

@ruudk

Description

@ruudk

Let's say you have the following:

class MyHandler {
    public function handle(MyCommand $command) {}
}

class MyCommand {
    public function __construct(public string $name) {}
}

class MyController {
    public function __invoke() {
        $this->commandBus->dispatch(new MyCommand('Ruud'));
    }
}

The above should return in no dead classes.

But when MyCommand is not dispatched anywhere, it should mark MyHandler + MyCommand as dead.

Same with an Event and multiple event subscribers to that event. If the event is never dispatched, the event + all the subscribers should be marked as dead.

https://symfony.com/doc/current/components/messenger.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions