Cees-Jan

ReactPHP: Timers

One of ReactPHP's simplest feature is timers. They are a core functionality exposed by the event-loop. Timers are an incredible powerful yet simple feature that can get you into trouble if you don't watch out. During this post we'll look at all different kind of interactions you can do with timers.

Tick tack tick tack


Read on →

Categories: ReactPHP Tags: ReactPHP - Timers

Cees-Jan

ReactPHP: Introduction

ReactPHP brings the concept of asynchronous I/O, as seen in NodeJS and others, to PHP. For many PHP developers this requires a completely different mindset then your average page handling request or CLI command. In this series we'll explore the different bits and components that make up ReactPHP. From the mid-level packages such as react/http-client all the way down to to it's core: react/event-loop.

ReactPHPMind blown


Read on →

Categories: ReactPHP - ReactPHP Series Tags: ReactPHP

Cees-Jan

The ReactPHP event-loop explained: Part 1 Streams

The event-loop is the core of ReactPHP. It provides an abstraction layer for polling file descriptors, timers and deferred execution of callbacks. On this event-loop most other react packages are build one way or the other.

In part 1 of this series we'll build a simple telnet service that allows you to lookup the IP addresses of hostnames. Part 2 go in-depth about timers. Part 3 will cover ticks. This is a long and verbose post, here is a TL;DR.


Read on →

Categories: ReactPHP - Event Loop - DNS - Telnet - Streams