Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for decorating messenger handlers #2

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

yceruto
Copy link
Owner

@yceruto yceruto commented Dec 12, 2024

When symfony/messenger component is installed, you can use any decorator around the message handler:

namespace App\Handler;

use Yceruto\DecoratorBundle\Decorator\Doctrine\ORM\Transactional;

#[AsMessageHandler]
class ProductCreatedEventHandler
{
    #[Transactional]
    public function __invoke(ProductCreatedEvent $event): void
    {
        // update other related information...
    }
}

@yceruto yceruto merged commit 8124f45 into main Dec 13, 2024
4 checks passed
@yceruto yceruto deleted the decorate_messenger_handler branch December 13, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant