The SitePoint PHP blog has posted a tutorial from Christopher Pitt introducing you to using event loops in PHP, a feature that allows for asynchronous processing, executing code while waiting for other code to finish.
PHP developers are always waiting for something. Sometimes we’re waiting for requests to remote services. Sometimes we’re waiting for databases to return rows from a complex query. Wouldn’t it be great if we could do other things during all that waiting?
If you’ve written some JS, you’re probably familiar with callbacks and DOM events. And though we have callbacks in PHP, they don’t work in quite the same way. That’s thanks to a feature called the event loop.
He suggests that PHP developer "get out of the single threaded mindset" and work in ways to handle asynchronous processing into their code to improve performance and flexibility.