leeshan87 / reactphp-multi-loop
Manage multiple LoopInterfaces easily when writing tests.
Fund package maintenance!
Patreon
www.buymeacoffee.com/LeeShan87
Installs: 3 405
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.5
- react/event-loop: ~1.0
Requires (Dev)
- phpunit/phpunit: ^9.3 || ^5.7 || ^4.8.35
README
Manage multiple LoopInterfaces easily when writing tests.
Quickstart example
$loop1 = Factory::create(); $loop1->futureTick(function(){ echo 'hello '; }); MultiLoop::addLoop($loop1, 'loop1'); $loop2 = Factory::create(); $loop2->futureTick(function (){ echo 'world!'; }); MultiLoop::addLoop($loop1, 'loop2'); MultiLoop::tickAll();
Install
The recommended way to install this library is through Composer. New to Composer?
This will install the latest supported version:
$ composer require leeshan87/reactphp-multi-loop:^0.1
See also the CHANGELOG for details about version upgrades.
This project aims to run on any platform and thus does not require any PHP extensions and supports running on legacy PHP 5.3 through current PHP 8+. It's highly recommended to use PHP 7+ for this project.
Tests
To run the test suite, you first need to clone this repo and then install all dependencies through Composer:
$ composer install
To run the test suite, go to the project root and run:
$ php vendor/bin/phpunit
License
MIT