Using the ReactPHP library

ReactPHP is an event-driven, non-blocking I/O library. This library relies essentially on an event loop that polls file descriptors, uses timers and defers callbacks by registering and executing outstanding ticks on each iteration of the loop.

ReactPHP is based on the Reactor pattern which, according to Douglas C. Schmidt, is a "design pattern that handles service requests that are delivered concurrently to an application by one or more clients. Each service in an application may consist of several methods and is represented by a separate event handler that is responsible for dispatching service-specific requests. Dispatching of event handlers is performed by an initiation dispatcher, which manages the registered ...

Get Mastering The Faster Web with PHP, MySQL, and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.