phpinnacle/ensign
Composer 安装命令:
composer require phpinnacle/ensign
包简介
PHPinnacle Signal Dispatcher
README 文档
README
PHPinnacle Ensign provides tools that allow your application components to communicate with each other by dispatching signals and listening to them.
Thanks to amphp backend those communication is fully asynchronous.
Install
Via Composer
$ composer require phpinnacle/ensign
Basic Usage
<?php require __DIR__ . '/vendor/autoload.php'; use PHPinnacle\Ensign\DispatcherBuilder; Amp\Loop::run(function () { $builder = new DispatcherBuilder; $builder ->register('upper', function (string $text) { return \strtoupper($text); }) ->register('lower', function (string $text) { return \strtolower($text); }) ; $dispatcher = $builder->build(); $hello = yield $dispatcher->dispatch('upper', 'hello'); $world = yield $dispatcher->dispatch('lower', 'WORLD'); echo sprintf('%s %s!', $hello, $world); });
More examples can be found in examples directory.
Testing
$ composer test
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email dev@phpinnacle.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 35
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 12
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-28