Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Symfony Finland:
Going Async in Symfony Controllers
Feb 22, 2016 @ 16:50:25

On the Symfony Finland site Jani Tarvainen has posted a tutorial showing you how to create asynchronous controller handling in a Symfony-based application.

Asynchronous programming has become a synonym for high performance in server side web applications in the recent years. This is largely due to the rising popularity of JavaScript and Node.js, in which everything is async by default. [...] So asynchronous programming does not push your computer into overdrive to enable higher performance. What it can do is help the computer to use it's resources more efficiently, by removing time spent waiting.

He then talks about PHP's typical flow model - synchronous and single-threaded. While it does make it simpler to debug/understand it also limits it and can cause higher processing times. Thanks to some other projects, however, asynchronous development with PHP has become more of a reality. He shows how to use one of these projects, Icicle, and its coroutines functionality to make a Symfony controller that handles calls to a sayHello method asynchronously, returning messages in a fraction of the normal processing time.

tagged: asynchronous controller tutorial icicle wait symfony

Link: https://www.symfony.fi/entry/going-async-in-symfony-controllers


Trending Topics: