SwooleWorker 长连接开发框架 V2.0.0 发布

栏目: 软件资讯 · 发布时间: 4年前

内容简介:SwooleWorker是基于swoole开发的一款分布式长连接开发框架。常驻内存,协程,高性能高并发;分布式部署,横向扩容,使得能支持庞大的连接数;无感知安全重启,无缝升级代码;接口丰富,支持单个发送,分组发送,群...

SwooleWorker是基于swoole开发的一款分布式长连接开发框架。常驻内存,协程,高性能高并发;分布式部署,横向扩容,使得能支持庞大的连接数;无感知安全重启,无缝升级代码;接口丰富,支持单个发送,分组发送,群发广播等接口。可广泛应用于云计算、物联网(IOT)、车联网、智能家居、网络游戏等领域。

系统架构

SwooleWorker 长连接开发框架 V2.0.0 发布

安装

composer require xielei/swoole-worker

接口

接口 参数 返回值
sendToClient string $client, string $message  
sendToUid string $uid, string $message, array $without_client_list = []  
sendToGroup string $group, string $message, array $without_client_list = []  
sendToAll string $message, array $without_client_list = []  
isOnline string $client  
isUidOnline string $uid bool
getClientListByGroup string $group, string $prev_client = null iterable
getClientCount   int
getClientCountByGroup string $group int
getClientList string $prev_client = null iterable
getClientListByUid string $uid, string $prev_client = null iterable
getClientInfo string $client, int $type = 255 array
getUidListByGroup string $group, bool $unique = true iterable
getUidList bool $unique = true iterable
getUidCount float $unique_percent = null int
getGroupList bool $unique = true iterable
getUidCountByGroup string $group int
closeClient string $client, bool $force = false  
bindUid string $client, string $uid  
unBindUid string $client  
joinGroup string $client, string $group  
leaveGroup string $client, string $group  
unGroup string $group  
setSession string $client, array $session  
updateSession string $client, array $session  
deleteSession string $client  
getSession string $client ?array

 更新日志

2.x对配置项做了优化,配置项修改即生效,无须重启~

在正式项目中,变更配置无须重启服务,用户无感知~

详情参考脚手架【https://gitee.com/hetangys/project】项目。

Register

  • debugregister_secretreload_watch等参数放入配置文件

Gateway

  • debugregister_secretreload_watch等放入配置文件
  • 新增自定义命令配置项command_extra_list,原来的自定义命令方式废弃
  • 新增路由配置项router,原来的路由设置方式废弃
  • 限流相关配置项throttlethrottle_intervalthrottle_timesthrottle_close放入配置文件

Worker

  • debugregister_secretreload_watch等参数放入配置文件
  • worker_filetask_file等参数放入配置文件
  • 新增tag_list配置项,设置worker的标签,在gateway中可以根据此标签增强路由分配

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Introduction to Graph Theory

Introduction to Graph Theory

Douglas B. West / Prentice Hall / 2000-9-1 / USD 140.00

For undergraduate or graduate courses in Graph Theory in departments of mathematics or computer science. This text offers a comprehensive and coherent introduction to the fundamental topics of graph ......一起来看看 《Introduction to Graph Theory》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具