2017 © Pedro Peláez
 

library loopio

Provides interoperability for components using the React and Alert event loops

image

daverandom/loopio

Provides interoperability for components using the React and Alert event loops

  • Tuesday, July 22, 2014
  • by DaveRandom
  • Repository
  • 2 Watchers
  • 6 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Loopio

Provides interoperability between Alert and React., (*1)

This library is simply a set of adapters that will allow you to use applications designed around the React event loop to work with an Alert event loop, and vice versa. It does not provide any complete functionality on its own., (*2)

Adapters are provided for all stable versions of React up to the 0.4.x series, and all stable versions of Alert up to the 0.8.x series, excluding the initial Alert release (0.1.0)., (*3)

Installation

Preferably via Composer., (*4)

"require": {
    "daverandom/loopio": "~0.1.0"
}

Usage

The best way to create the correct adapter for the installed React and Alert versions is to use the appropriate method of Loopio\LoopFactory. This will auto-detect the installed versions of Alert and React and return the correct adapter for your combination., (*5)


If you are using React as your primary event loop and you want to use a component designed around Alert in your application (such as Artax), an adapter can be created in the following manner:, (*6)

<?php

// Create a React event loop
$reactLoop = React\EventLoop\Factory::create();

// Create an Alert adapter
$alertLoop = (new Loopio\LoopFactory)->createAlertLoop($reactLoop);

// Create an Artax async client
$client = new Artax\AsyncClient($alertLoop);

If you are using Alert as your primary event loop and you want to use a component designed around React in your application (such as Ratchet), an adapter can be created in the following manner:, (*7)

<?php

// Create an Alert event loop
$alertLoop = (new Alert\ReactorFactory)->select();

// Create a React adapter
$reactLoop = (new Loopio\LoopFactory)->createReactLoop($alertLoop);

// Create a Ratchet app
$client = new Ratchet\App('localhost', 8080, '127.0.0.1', $reactLoop);

The Versions

22/07 2014

0.1.x-dev

0.1.9999999.9999999-dev

Provides interoperability for components using the React and Alert event loops

  Sources   Download

MIT

The Requires

 

22/07 2014

dev-master

9999999-dev

Provides interoperability for components using the React and Alert event loops

  Sources   Download

MIT

The Requires

 

18/06 2014

v0.1.0

0.1.0.0

Provides interoperability for components using the React and Alert event loops

  Sources   Download

MIT

The Requires