定制 jsor/global-loop 二次开发

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

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

jsor/global-loop

Composer 安装命令:

composer require jsor/global-loop

包简介

A global event loop for ReactPHP.

README 文档

README

A global event loop for ReactPHP.

Installation

Install the latest version with Composer.

composer require jsor/global-loop

Check the Packagist page for all available versions.

Usage

Typical applications use a single event loop. ReactPHP requires that you pass the loop instance around, eg. as argument to functions and class constructors.

This library allows to use a single event loop instance from everywhere by providing static global accessors.

The only requirement is to call the static Jsor\GlobalLoop::run() at the end of your program.

<?php

// Application runs here

Jsor\GlobalLoop::run();

You can then access the global loop instance from from inside your application code by calling Jsor\GlobalLoop::get().

The default loop implementation is created using React\EventLoop\Factory::create() which picks the best available loop implementation.

If you want to use a specific or custom loop implementation, you can set it with Jsor\GlobalLoop::set() at the beginning of your program.

<?php

Jsor\GlobalLoop::set(new MyLoopImplementation());

// Application runs here

Jsor\GlobalLoop::run();

License

Copyright (c) 2017 Jan Sorgalla. Released under the MIT License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固