ardillo / loop
ReactPHP Event Loop running on Ardillo
Requires
- php: >=8.1.0
- ext-ardillo: *
- react/event-loop: 1.4.0
Requires (Dev)
- phpstan/phpstan: ^1.9
- phpunit/phpunit: ^10.2
- react/promise: ^2.10
- vimeo/psalm: ^5.6
This package is auto-updated.
Last update: 2024-12-17 01:19:50 UTC
README
Ardillo Loop is an implementation of the ReactPHP Event Loop interface.
For documentation, please refer to the ReactPHP loop API reference: https://reactphp.org/event-loop/ as well as our examples: https://github.com/ardillo-php/examples
Note: Unlike the ReactPHP loop, Ardillo Loop cannot be restarted, i.e. once stopped, the implementing application is expected to prepare for termination. Given the nature of Ardillo applications (native desktop utilities), this should no be a limitation, however this can affect one's approach to unit testing.
This library also offers a ReactApp
class which extends the base Ardillo App
class in such fashion that the actual event loop management is abstracted away from the application logic. This allows for a more natural approach to writing Ardillo applications, where the application logic is not bound to the event loop implementation.
Installation
Before proceeding, make sure you have installed and enabled the Ardillo extension.
The recommended way to install Ardillo Loop is via Composer:
composer require ardillo/loop
Tests and Static Analysis
In order to run the tests, you need to clone the repository and install the dependencies via Composer:
git clone https://github.com/ardillo-php/loop.git
cd loop
composer install
You can then run the tests using the following command:
composer test
To run static analysis (PHPStan and Psalm), use the following commands:
composer phpstan composer psalm
License
The MIT License (MIT). Please see LICENSE
for more information.
Acknowledgments
This library extends the ReactPHP Event Loop and is inspired by the libuv loop implementation.
Contributing
Bug reports (and small patches) can be submitted via the issue tracker. Forking the repository and submitting a Pull Request is preferred for substantial patches. Please be sure to read and comply with the Contributing Terms document before proceeding.