In short, you will be doing event-driven programming, where you will work with what's called as the event loop, and attaching (hooking up) events to do your bidding.
Installation is a simple composer that is required is all.
How does Reactive PHP work? In PHP, there is no such way to create a server except when running the code php -S localhost:8000
. PHP will treat the current directory as the basis of the public directory (in Apache, usually this is /var/www
or C:/xampp/htdocs
when using XAMPP). This, by the way, has been available since PHP 5.4.0 only and also works with PHP 7.x.
There is no programmable way to control how that PHP command-line interface's server actually works.
Every time you send a request to that server, PHP server will be in charge of handling whether it's a valid request, and handle the event by itself. In short, every request is a new request-there's no streaming or events that get involved.
RxPHP works by creating an event loop by creating...