2017 © Pedro Peláez
 

library global-loop

A global event loop for ReactPHP.

image

jsor/global-loop

A global event loop for ReactPHP.

  • Monday, August 21, 2017
  • by jsor
  • Repository
  • 1 Watchers
  • 2 Stars
  • 8 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Global Loop

A global event loop for ReactPHP., (*1)

Installation

Install the latest version with Composer., (*2)

composer require jsor/global-loop

Check the Packagist page for all available versions., (*3)

Usage

Typical applications use a single event loop. ReactPHP requires that you pass the loop instance around, eg. as argument to functions and class constructors., (*4)

This library allows to use a single event loop instance from everywhere by providing static global accessors., (*5)

The only requirement is to call the static Jsor\GlobalLoop::run() at the end of your program., (*6)

<?php

// Application runs here

Jsor\GlobalLoop::run();

You can then access the global loop instance from from inside your application code by calling Jsor\GlobalLoop::get()., (*7)

The default loop implementation is created using React\EventLoop\Factory::create() which picks the best available loop implementation., (*8)

If you want to use a specific or custom loop implementation, you can set it with Jsor\GlobalLoop::set() at the beginning of your program., (*9)

<?php

Jsor\GlobalLoop::set(new MyLoopImplementation());

// Application runs here

Jsor\GlobalLoop::run();

License

Copyright (c) 2017 Jan Sorgalla. Released under the MIT License., (*10)

The Versions

21/08 2017

dev-master

9999999-dev https://github.com/jsor-labs/global-loop

A global event loop for ReactPHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

asynchronous async global reactphp event-loop

21/08 2017

v1.0.0

1.0.0.0 https://github.com/jsor-labs/global-loop

A global event loop for ReactPHP.

  Sources   Download

MIT

The Requires

 

The Development Requires

asynchronous async global reactphp event-loop