Загрузка страницы

Delay heavy tasks in Symfony with component Messenger

In this tutorial I explain how you can delay tasks in Symfony application using component messenger. Learn how you can improve response time for specific endpoints by processing tasks later using queue system, for example, you can use Redis, AMQP, Doctrine, Amazon SQS or others.
Step by step I demonstrate this process with simple example. Below you will find a link to the repository with final code. The project is dockerized and has Xdebug. So you can easily run it locally and check execution.

#Messenger #Queue #Symfony

In this video I use Symfony 5 with PHP 8 but this tutorial is still relevant for older versions of Symfony framework or PHP.

⭐️ Link to first part of my tutorial about Symfony kernel terminate event ⭐️
🔗 https://youtu.be/HrQme9KUlUg

⭐️ Final result you can find here ⭐️
🔗 https://github.com/Cap-Coding/symfony_tutorial_delay_tasks_messenger

⭐️ Support channel on Patreon ⭐️
🔗 https://www.patreon.com/capcoding

⭐️ Resources ⭐️
🔗 Symfony documentation about Messenger component https://symfony.com/doc/current/components/messenger.html
🔗 PHP documentation about magic invoke method https://www.php.net/manual/en/language.oop5.magic.php#object.invoke
🔗 Supervisor process manager http://supervisord.org/
🔗 Book O'Reilly "Head first design patterns"
Amazon: https://amzn.to/2KVHD0D (new edition)
Amazon: https://amzn.to/2NMfTN9
Amazon DE: https://amzn.to/2Xq3TCt
🎥 All Symfony tutorials https://www.youtube.com/playlist?list=PLKQc-wMFDsrEt6U5LKLETR2d4nhW0ieNI

Get € 20 on Hetzner Cloud hosting:
💲https://hetzner.cloud/?ref=GyXEuMSuxUBq

Register domain without hassle on GoDaddy
💲https://letyshops.com/r/godaddy-87becf0c4e38

⭐️ Redis queries⭐️
🛠 Get all keys
KEYS *
🛠 Get type of the key
TYPE messages
🛠 Read stream
XREAD COUNT 10 STREAMS messages writers 0-0 0-0
⭐️ Messenger commands ⭐️
🛠 To debug messenger:
php bin/console debug:messenger
🛠 To consume messages (to run a worker)
php bin/console messenger:consume async -vv
🛠 To stop workers
php bin/console messenger:stop-workers

⭐️ TABLE OF CONTENT ⭐️
00:00:00 Introduction
00:01:23 How component Messenger works
00:04:30 Messenger implementation
00:12:03 Check messages in Redis
00:12:43 Hints and tips

Видео Delay heavy tasks in Symfony with component Messenger канала Cap Coding
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
27 июня 2021 г. 3:06:08
00:13:53
Яндекс.Метрика