承接 envoylope/event-loop 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

envoylope/event-loop

最新稳定版本:v0.1.0

Composer 安装命令:

composer create-project envoylope/event-loop

包简介

README 文档

README

Build Status

Transmits AMQP heartbeats for Envoylope using a ReactPHP EventLoop.

Usage

Install with Composer:

$ composer require envoylope/event-loop

(Optionally) install Tasque and Tasque EventLoop

If you are running a traditional PHP application, a ReactPHP EventLoop may regularly be blocked by synchronous logic/IO. This can be mitigated somewhat by Tasque EventLoop, which implements green threads for PHP.

See the respective usage instructions linked above for configuring the Tasque/EventLoop Nytris packages.

Configuring platform boot config

Once the PHP AMQP-Compat Nytris package is configured, this scheduler will be used:

nytris.config.php

<?php

declare(strict_types=1);

use Asmblah\PhpAmqpCompat\AmqpCompatPackage;
use Asmblah\PhpCodeShift\Cache\Layer\FilesystemCacheLayerFactory;
use Asmblah\PhpCodeShift\ShiftPackage;
use Envoylope\EventLoop\EventLoopSchedulerFactory;
use Nytris\Boot\BootConfig;
use Nytris\Boot\PlatformConfig;
use Tasque\Core\Scheduler\ContextSwitch\TimeSliceStrategy;
use Tasque\EventLoop\TasqueEventLoopPackage;
use Tasque\TasquePackage;

$bootConfig = new BootConfig(new PlatformConfig(__DIR__ . '/var/cache/nytris'));

$bootConfig->installPackage(new AmqpCompatPackage(
    // Install the scheduler.
    schedulerFactory: new EventLoopSchedulerFactory()
));
$bootConfig->installPackage(new ShiftPackage(
    cacheLayerFactory: new FilesystemCacheLayerFactory(),
    relativeSourcePaths: ['src', 'vendor']
));
$bootConfig->installPackage(new TasquePackage(
    new TimeSliceStrategy(timeSliceCheckIntervalTocks: 100)
));
$bootConfig->installPackage(new TasqueEventLoopPackage());

return $bootConfig;

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-11-13