swoole/zmq
最新稳定版本:v0.1.3
Composer 安装命令:
composer require swoole/zmq
包简介
ZeroMQ bindings for Swoole.
README 文档
README
ZeroMQ bindings for Swoole.
Install
The recommended way to install swoole/zmq is through composer.
{
"require": {
"swoole/zmq": "0.1.*"
}
}
composer require swoole/zmq
Example
And don't forget to autoload:
<?php require 'vendor/autoload.php';
Here is an example of a push socket:
$zmq = new Swoole\Async\ZMQ(); $zmq->on('Message', function ($msg) { echo "Received: $msg\n"; }); $zmq->bind('tcp://0.0.0.0:9530');
And the pull socket that goes with it:
$zmq = new Swoole\Async\ZMQ(); $zmq->connect('tcp://0.0.0.0:5555'); Swoole\Timer::tick(1000, function () use ($zmq) { static $i = 0; $msg = "hello-" . $i++; echo "Sending: $msg\n"; $zmq->send($msg); });
统计信息
- 总下载量: 3.05k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 37
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL
- 更新时间: 2017-08-18