The main purpose of this book is to get you started with developing asynchronous applications in PHP. I will show you that PHP is much more than run the script, execute some code and die. You will be amazed by the way your familiar PHP language can be used! The asynchronous model will definitely expand the way you think about PHP.
In fact, there is no need to learn a new language when you need to write some asynchronous stuff just because someone blames PHP that it is not a right tool. You can create asynchronous applications in PHP and this book will show you how.
It will be a step by step guide to building an asynchronous PHP application.
I have to emphasize and appreciate the hands-on and iterative approach of the book, which from my experience is not that common in programming books. While I understand that they need to focus on the subject and not a bunch of other things like best practices and architecture, I feel like this can lead to poor code in the name of "just getting things done".
The book explains how to use ReactPHP components to build a small app that allows to upload, display and download images. There are several things to learn here: - How to create a simple web server in a non-blocking way - How to implement routing - Using child processes - Input and output streams - Events - Promises - Error handling
Each step explains how to add new functionality to the app and then how to refactor the code in a way that it's more readable and extensible.
There was something I had trouble with and it's not addressed in the book: some images would fail to upload because of its size (even though they were not really big, barely over 1 Mb). I had to add the following middlewares when instantiating the Server object: