基于 Redis 的延迟消息队列中间件,采用 Golang 开发,支持 PHP、Golang 等多种语言客户端。php
参考 有赞延迟队列设计 中的部分设计,优化后实现。linux
项目连接:https://github.com/mixstart/d... ,有须要的朋友加 Star 哦。git
delayer
分为:github
push
、pop
、bPop
、remove
方法操做任务。在 https://github.com/mixstart/d... 中下载对应平台的程序。golang
支持 windows、linux、mac 三种平台
而后修改配置文件 delayer.conf
:redis
[delayer] pid = /var/run/delayer.pid ; 单例执行, 多实例执行留空, Win不支持 timer_interval = 1000 ; 计算间隔时间, 单位毫秒 access_log = logs/access.log ; 存取日志 error_log = logs/error.log ; 错误日志 [redis] host = 127.0.0.1 ; 链接地址 port = 6379 ; 链接端口 database = 0 ; 数据库编号 password = ; 密码, 无需密码留空 max_idle = 2 ; 最大空闲链接数 max_active = 20 ; 最大激活链接数 idle_timeout = 3600 ; 空闲链接超时时间, 单位秒 conn_max_lifetime = 3600 ; 链接生存时间, 单位秒
查看帮助:数据库
[root@localhost bin]# ./delayer -h Usage: delayer [options] Options: -d/--daemon run in the background -c/--configuration FILENAME -- configuration file path (searches if not given) -h/--help -- print this usage message and exit -v/--version -- print version number and exit
启动:apache
[root@localhost bin]# ./delayer ____ __ / __ \___ / /___ ___ _____ _____ / / / / _ \/ / __ `/ / / / _ \/ ___/ / /_/ / __/ / /_/ / /_/ / __/ / /_____/\___/_/\__,_/\__, /\___/_/ /____/ Service: delayer Version: 1.0.1 [info] 2018/10/19 11:24:24 Service started successfully, PID: 31023
咱们提供了如下几种语言:windows
根据对应项目的说明使用
Apache License Version 2.0, http://www.apache.org/licenses/服务器