Using the RxPHP extensions opens up quite a few possibilities. Its observables, operators, and subscribers/observers implementations are certainly powerful. What they don't provide, however, is asynchronicity. This is where the React library comes into play, by providing an event-driven, non-blocking I/O abstraction layer. Before we touch upon React, let's first lay out a trivial example of blocking versus non-blocking I/O in PHP.
We create a small beacon script that will merely generate some standard output (stdout) over time. Then, we will create a script that reads from the standard input (stdin) and see how it behaves when reading is done in the stream blocking and stream non-blocking mode.
We start by creating the beacon.php ...