Learning Event Driven PHP With ReactPHP — Sergey Zhuk
My short review of “Learning Event Driven PHP With ReactPHP”, an ebook by Sergey Zhuk.
The PHP programming language has a few features that can be used for asynchronous programming. In fact, more than 10 years ago, it already had what you need to develop a simple chat server1! Thing is, asynchronous is not (yet) something most PHP programmers are used to do.
These past few years though, a couple of frameworks have started reaching a high level of maturity, when it comes to asynchronous and event-driven programming on PHP. ReactPHP is one of those frameworks.
In this book, you will read about the event-loop, how to set up timers and understanding ticks, and work with streams and promises. You will of course build the famous chat server and client, improve it, and then move to more complex examples. You will also work learn how to use ReactPHP to do asynchronous HTTP requests. Finally, the last chapter gives a few pointers on how to work with all this in an existing application.
→ 4⁄5 If you have never used ReactPHP and want to develop an application using an event-driven / asynchronous approach, this book will help you. It presents the concepts in a clear and concise way and contains several examples. I’m going up to 5⁄5 though, as I would have liked reading a bit more about more real life usages for asynchronous in PHP and I would have loved a chapter about storage (to some database, Redis, …)
Note: I read the version published in October 2017. There has since been at least one update, bringing a couple new chapters. And after I sent a bit of feedback to the author, he answered he would take it into consideration for a future update – which means this book should get even better soon – and it’s always nice when you can talk with an author!
- You know, the typical kind of example everyone uses for some other language or some framework. Well, you could already do that with PHP 4.3! [return]