Creating Realtime Applications with PHP and Websockets
Below you will find descriptions and links to the interactive demos used for the presentation.
The todo list demo takes a basic CRUD implementation of a todo list and turns it on it's head. This demo introduces the ability to add WebSockets to an existing PHP application. This does come at quite a cost, however, as it entails adding a messaging layer to your existing application so it may talk to the WebSocket server. In our case, we use ZeroMQ as it is supported by react/zeromq. The application also introduces the WAMP sub-protocol of WebSockets, allowing us to use RPC and PubSub patterns to manage the sheer number of different event types. One of the key takeaways from this demo is the amount of edge-cases that need to be handled due to concurrency. This includes various forms of locking to ensure users don't step on each other's toes.