Think about "PHP" for a few seconds… What came to mind? It’s very likely you thought about your average product catalog, a blogging platform or how the platform is inferior to things like Node.js. But wait, it’s 2018! What if I told you PHP’s huge ecosystem has way more to offer and PHP is not inferior at all to its evil cousin Node.js?
Hands-on workshop given at PHPYorkshire (2018-04-13)
In this hands-on tutorial you will learn about the core concepts of async PHP and why you too should care about ReactPHP being a real thing. The workshop has a strong focus on sparking the idea that PHP can be way faster and more versatile than you probably thought. Bring along an open mind and through lots of interesting examples and live demos learn why what sounds crazy at first might soon be a valuable addition in your toolbox.
You’re already familiar with PHP and want to learn what ReactPHP is all about? Then this tutorial is for you! We will start from scratch and build a demo application that pushes data from your command line in real-time to your browser. Several scenarios are prepared, but ideally you bring in your own ideas: Let’s build an interactive chat bot, an interactive CLI tool or even an actual desktop GUI, it’s up to you!
The tutorial assumes people are familiar with PHP, have PHP and their favorite IDE already setup, but does not require people to be familiar with ReactPHP.
The slides are available on https://speakerdeck.com/clue/getting-started-with-reactphp-pushing-real-time-data-to-the-browser-phpyorkshire.
These slides were used as part of a hands-on workshop at @PHPYorkshire. The full workshop took 3h with basic project setup, getting started with ReactPHP's core components and eventually implementing an HTTP server using Server-Sent Events (EventSource).
Resulting source code can be found on https://gist.github.com/clue/6ba091ed298b1ecec528a3a6c201a2d1.
Overall, I'm really happy with how the workshop went and this seems to be confirmed by some very positive feedback that attendeed left.
One minor issue was an outdated installation of clue/packagist-api-react during the workshop, which we managed to work around without too much trouble. As a result, I've just updated released v1.2.0 to make sure this is now compatible with all the latest versions (no code changes required) and have updated the resulting workshop code.