pe/component-loop
最新稳定版本:v1.1.0
Composer 安装命令:
composer require pe/component-loop
包简介
Timers loop
README 文档
README
The following versions of PHP are supported.
- PHP 7.4+
Installation
To install, use composer:
php composer.phar require pe/component-loop
Usage
Loop used for run some callable delayed or repeated, example:
namespace PE\Component\Loop; $loop = new Loop(); // For delayed run callable add singular timer $loop->addSingularTimer(0.1, static function (Loop $loop, Timer $timer) { // Do some work delayed by 0.1 second }); // For repeated run callable add periodic timer $loop->addPeriodicTimer(0.5, static function (Loop $loop, Timer $timer) { // Do some work at each 0.5 second }); // For stop loop execution you may add special timer $loop->addSingularTimer(60, static function (Loop $loop) { $loop->stop(); }); // Run loop $loop->run();
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2022-07-09