Back to Browse

Delay heavy tasks in Symfony with kernel.terminate event to decrease response time

3.6K views
Jun 6, 2021
13:06

In this tutorial I explain how you can delay tasks in Symfony application using kernel terminate event. Learn how you can improve response time for specific endpoints. You can perform heavy task after http with Symfony event kernel terminate. 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. #KernelTerminate #DelayTasks #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 second part of my tutorial about Symfony component Messenger ⭐️ 🔗 https://youtu.be/UHlA5nHdCmw ⭐️ Final result you can find here ⭐️ 🔗 https://github.com/Cap-Coding/symfony_tutorial_delay_tasks_kernel_terminate ⭐️ Support channel on Patreon ⭐️ 🔗 https://www.patreon.com/capcoding ⭐️ Resources ⭐️ 🔗 Symfony documentation about kernel terminate event https://symfony.com/doc/current/reference/events.html#kernel-terminate 🔗 Symfony documentation about kernel component https://symfony.com/doc/current/components/http_kernel.html#component-http-kernel-kernel-terminate 🔗 Information about PHP function fastcgi_finish_request https://www.php.net/manual/en/function.fastcgi-finish-request.php 🔗 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 ⭐️ TABLE OF CONTENT ⭐️ 00:00:00 Introduction 00:01:19 How event kernel terminate works 00:03:02 Symfony example for GET endpoint 00:09:27 Symfony example for POST endpoint 00:12:14 Pros and Cons

Download

0 formats

No download links available.

Delay heavy tasks in Symfony with kernel.terminate event to decrease response time | NatokHD