Download the PHP package zhamao/connection-manager without Composer
On this page you can find all versions of the php package zhamao/connection-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download zhamao/connection-manager
More information about zhamao/connection-manager
Files in zhamao/connection-manager
Download zhamao/connection-manager
More information about zhamao/connection-manager
Files in zhamao/connection-manager
Vendor zhamao
Package connection-manager
Short Description A swoole-based multi-process connection manager using shared memory table
License Apache-2.0
Package connection-manager
Short Description A swoole-based multi-process connection manager using shared memory table
License Apache-2.0
Please rate this library. Is it a good library?
Informations about the package connection-manager
zhamao-connection-manager
一个基于 Swoole\Table 的简易 Websocket/HTTP 连接属性扩充管理器,兼容 Swoole 多进程的。
A swoole-based multi-process connection manager using shared memory table
安装
通过 Composer
用法
1.在 Swoole\Server->start() 前执行初始化:
参数如下:
$max_conn: (必填) 设置服务器最大接收的连接属性储存的数目$conflict_proportion: (选填) hash 冲突的最大百分比 (默认0.2),有关此参数,见 Swoole 文档。$options: (选填) 自定义属性参数的键名参数列表,用于添加自定义字段 (默认为空数组)
以下是带丰富参数的用例初始化方式:
参数初始化的必填字段为
key,type,其中type限定为以下类型:string,int,float,int1,int2,int8
size属性在type为string时必须填写,为字符串的最大长度。储存过程中如果字符串输入过长,会自动截断。
2.在 Swoole 服务器的 onOpen 或 onRequest 事件最开始执行的代码:
参数如下:
$fd: (必填) 设置服务器最大接收的连接属性储存的数目$name: (选填) 连接对象的类型名称 (默认default)$options: (选填) 自定义属性参数的键名参数列表,用于添加和设置自定义字段 (默认为空数组)
高级用例:
3.在 Swoole 服务器的 onClose 事件执行的代码(销毁连接对象):
4.在 Swoole 服务器的 message 或 request 事件下可以用的方法:
All versions of connection-manager with dependencies
PHP Build Version
Package Version
The package zhamao/connection-manager contains the following files
Loading the files please wait ...