drx777 / athrois
dev-master
2015-08-04 14:05 UTC
Requires (Dev)
- phpunit/phpunit: 4.x
- satooshi/php-coveralls: dev-master
This package is not auto-updated.
Last update: 2024-10-02 09:39:57 UTC
README
Athrois: PHP 消息总线
Athrois 是 PHP 中一个轻量级的集中式消息总线示例实现,它是发布/订阅模式的变种。
名称
万物皆有名称。Athrois 来源于希腊语“ἄθροισις”,意为集合。这个实现使用一个池来“集合”各种不同的监听器。
结构
存在一个中央池对象,类型为 Athrois\Pool
,它可以接受注册事件的监听器。您的监听器需要实现 Athrois\Listener
接口(需要实现 notify()
方法);事件需要实现 Athrois\Event
接口(无方法)。
状态
不打算用于生产环境,这是一个示例。如果您偶然发现它有实际应用,请告诉我它是如何工作的。
通过 composer 安装
"require": {
…
"drx777/athrois": "dev-master"
},
"repositories": [
{
"type": "vcs",
"url": "git://github.com/drx777/Athrois.git"
}
],
用法
查看示例/demo01.php …