Skip to content
Frode Børli edited this page Feb 5, 2015 · 12 revisions

Fubber Reactor is a powerful PHP application server based on the fantastic React PHP Project. It supports long running blocking PHP scripts through forking, as well as the asynchronous event model adopted by node.js. In other words; you get the best of both worlds!

Configuring Fubber Reactor

The simplest way to configure Fubber Reactor is via composer. Simply follow these steps:

  1. Download and install composer (skip if you already have done this)

    curl -sS https://getcomposer.org/installer | php

  2. Add Fubber Reactor as a dependency to your project

    ./composer.phar require fubber/reactor:dev-master

  3. Start Fubber Reactor

    ./vendor/bin/fubber-reactor

That's it! Point your browser to http://localhost:1337/ to test (not working?). Now, you simply need to create some controllers that will respond to requests on your server.

Features

The Fubber Reactor server currently has only a few features. I will be adding features to it as I need new features for my projects. The current feature set has been enough for me to implement a scalable publish/subscribe message server (named PubSub). I'm currently in the process of structuring my PubSub server, so that it can live along with any other project you decide to install on the Fubber Reactor. Once I'm done with that I will publish that also as a composer package.

  • Flexible routing tables based on json files in the routes/ folder.
  • Forking Controller allows you to create endpoints that spawn a separate process. Use this for heavy calculations and other long running CPU bound tasks. Simply extend \Fubber\Reactor\ForkingController instead of \Fubber\Reactor\Controller. Unfortunately, the ForkingController requires manual changes to the ReactPHP source code and should be avoided for now.
  • Inherits a powerful event loop from ReactPHP, which makes it simple to do almost everything people use node.js for currently.
Clone this wiki locally