Subscribe to PHP Freaks RSS

Sergey Zhuk: Asynchronous PHP: Why?

syndicated from on February 2, 2018

In a post to his site Sergey Zhuk shares his opinion on asynchronous PHP and why it's in such demand these days in web-based applications.

Asynchronous programming is on demand today. Especially in web-development where responsiveness of the application plays a huge role. No one wants to waste their time and to wait for a freezing application, while you are performing some database queries, sending an email or running some other potentially long-running tasks.

Users want to receive responses to their actions, and they want these responses immediately. When your application becomes slow, you start losing your clients. Once a user has to deal with a freezing application, in most cases he or she simply closes it and never returns. When the UI freezes from the user’s point of view, it is not clear if your application is broken, or it is performing some long-running task and requires some time for it.

He goes on to talk about the importance of responsiveness in web applications and clearing up the difference between running tasks in parallel and running them asynchronously. He also talks briefly about the use of asynchronous processing on the backend and how it compares to other technology (like Node.js and Go) that have built-in asynchronous processing.