定制 krinfreschi/async-streams 二次开发

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

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

krinfreschi/async-streams

Composer 安装命令:

composer require krinfreschi/async-streams

包简介

README 文档

README

A stream wrapper around reactphp for async streams

With inspiration from guzzle/streams

##Installation

This package can be installed easily using Composer. Simply add the following to the composer.json file at the root of your project:

{
  "require": {
    "krinfreschi/async-streams": "0.0.*"
  }
}

Then install your dependencies using composer.phar install.

##Global Functions:

async_stream_register_read(resource $handle, callable $callable) //$callable will receive args: $handle
async_stream_remove_read(resource $handle)
async_stream_register_write(resource $handle, callable $callable) //$callable will receive args: $handle, $written, $unwritten
async_stream_remove_write(resource $handle)

##Example:

use krinfreschi\AsyncStreams\AsyncStreamWrapper;

require_once "vendor/autoload.php";

$resource = fopen('php://temp', 'r+');
$handle = AsyncStreamWrapper::make($resource);
fwrite($handle, 'data');

async_stream_register_write($handle, function($handle, $written, $unwritten) {
    fseek($handle, 0);
    var_dump(stream_get_contents($handle));
    fclose($handle);
});

AsyncStreamWrapper::run();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固