supervisorphp/event 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

supervisorphp/event

最新稳定版本:v0.2.0

Composer 安装命令:

composer require supervisorphp/event

包简介

Listen to Supervisor events in PHP

README 文档

README

Latest Version Software License Total Downloads Test Suite

Listen to Supervisor events in PHP.

Install

Via Composer

$ composer require supervisorphp/event

Usage

Supervisor has this pretty good feature: notify you(r listener) about it's events.

The main entry point is the Listener. Listenerss wait for a Handler in the main listening logic. Handlers get a Notification when an event occurs.

$handler = new \Supervisor\Event\Handler\CallbackHandler(function(\Supervisor\Event\Notification $notification) {
	echo $notification->getHeader('eventname');
});

$listener = new \Supervisor\Event\Listener\StandardListener;
$listener->listen($handler);

Currently available listeners:

  • Standard: Listents to standard input stream, writes to standard output
  • Guzzle: Uses StreamInterface to provide an easy interface for reading/writting

Additionally you can use two exceptions to control the listeners itself:

  • Supervisor\Exception\StopListenerException: indicates that the Listener should stop listening for further events.
  • Supervisor\Exception\EventHandlingFailedException: indicates that handling the event failed, Listener should return with a FAIL response.

Any other unhandled exceptions/errors will cause the listener to stop.

Check the Supervisor docs for more about Events.

Testing

phpspec run

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-01-13