1 Star 0 Fork 0

laochi / Streamqueue

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

Streamqueue

介绍

基于 PHP 扩展 swoole + redis的stream数据类型开发的队列服务.

软件架构

php-7.2

swoole-4.5.4

redis-5.0.3

安装教程

clone

修改config目录下sample文件

使用说明

启动服务: php Command.php -f boot

入队测试: php Command.php -f inqueue -n 10

项目调用:

服务端:

src/task/tasks/目录下建立以消费者名称命名的目录,

目录里建立Consumer.php和Payload.php,分别为消费逻辑和消费参数文件

客户端:

use streamqueue\classes\Client;

$retryDelay = [2, 2];//每次尝试与上次尝试间隔秒数
$payload = [
    'phone' => '130'. rand(10000000, 99999999),
    'text' => 'smscontentaaabbbccc',
];
$client = new Client();
$client->setUrl('127.0.0.1:9501');//启动的服务
$client->setConsumer('Test1');//消费者名称
$client->setRetryDelay($retryDelay);
$client->setPayload($payload);
$result = $client->send();

空文件

简介

暂无描述 展开 收起
PHP
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/laochi/streamqueue.git
git@gitee.com:laochi/streamqueue.git
laochi
streamqueue
Streamqueue
master

搜索帮助