From 3b7a46dd9e181da748f34b55765621294f4f9021 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Mon, 23 Oct 2023 16:23:42 +0200 Subject: [PATCH] Add notice to messenger for async code --- src/Controller/BlogController.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Controller/BlogController.php b/src/Controller/BlogController.php index 0a8afa60d..7155479f7 100644 --- a/src/Controller/BlogController.php +++ b/src/Controller/BlogController.php @@ -123,6 +123,9 @@ public function commentNew( // passed in the event and they can even modify the execution flow, so // there's no guarantee that the rest of this controller will be executed. // See https://symfony.com/doc/current/components/event_dispatcher.html + // You can also leverage the Symfony Messenger component if you need + // some asynchronous operations. + // See https://symfony.com/doc/current/messenger.html $eventDispatcher->dispatch(new CommentCreatedEvent($comment)); return $this->redirectToRoute('blog_post', ['slug' => $post->getSlug()]);