定制 charm/loop 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

charm/loop

Composer 安装命令:

composer require charm/loop

包简介

Identical API for ReactPHP, Swoole, AMP and plain PHP.

README 文档

README

A minimal event loop implementation which automatically detects the ReactPHP, Amp and Swoole event loops and integrates with them. If no event loop is found, it falls back to the built-in PHP register_shutdown_function() to create an event loop.

Interface

Charm\Loop::defer(callable $callback) is the primary function for adding operations to the event loop. This function maps directly to the corresponding loop function in ReactPHP, Amp, Swoole or the internal register_shutdown_function() event loop.

Charm\Loop::onReadable(resource $stream, callable $listener) will invoke the provided $listener as soon as reading the $stream resource will no longer block. The $listener callback will not be invoked until the next iteration of the event loop.

Charm\Loop::onWritable(resource $stream, callable $listener) will invoke the provided $listener as soon as writing the $stream resource will no longer block. The $listener callback will not be invoked until the next iteraton of the event loop.

Charm\Loop::setTimeout(float $seconds, callable $callback) will invoke $callback after $seconds seconds.

Charm\Loop::setInterval(float $interval, callable $callback) will invoke $callback every $seconds second.

统计信息

  • 总下载量: 5
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-07-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固