https://github.com/yurunsoft/swoole-shared-memory
Swoole Shared Memory (简称 SSM) 是为了解决 Swoole 常驻内存场景,多进程变量共享问题而开发的组件。
https://github.com/yurunsoft/swoole-shared-memory
php sharedmemory swoole
Last synced: 12 months ago
JSON representation
Swoole Shared Memory (简称 SSM) 是为了解决 Swoole 常驻内存场景,多进程变量共享问题而开发的组件。
- Host: GitHub
- URL: https://github.com/yurunsoft/swoole-shared-memory
- Owner: Yurunsoft
- License: mit
- Created: 2018-12-19T06:18:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-09-17T08:16:01.000Z (over 4 years ago)
- Last Synced: 2025-03-28T21:03:33.827Z (about 1 year ago)
- Topics: php, sharedmemory, swoole
- Language: PHP
- Homepage: https://gitee.com/yurunsoft/swoole-shared-memory
- Size: 162 KB
- Stars: 8
- Watchers: 2
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# swoole-shared-memory
[](https://packagist.org/packages/yurunsoft/swoole-shared-memory)
[](https://secure.php.net/)
[](https://github.com/swoole/swoole-src)
[](https://github.com/Yurunsoft/swoole-shared-memory/blob/master/LICENSE)
## 介绍
`Swoole Shared Memory` ( 以下简称 `SSM` ) 是为了解决 `Swoole` 常驻内存场景,多进程变量共享问题而开发的组件。
`SSM` 直接支持任意变量的跨进程共享,它是通过序列化和反序列化实现的。不仅支持常用的 `KV` 操作,还支持`Stack`、`Queue` 和 `PriorityQueue`数据结构操作。
`SSM` 通过 `Unix Socket` 内核通信,不走网卡,效率极高。无需预先定义空间大小、字段等,甚至可以与 `fpm` 项目进行变量共享 ( `fpm` 项目仅可作为客户端 )。
你只需要在 `Swoole` 自定义进程中启动 `SSM` 服务来监听 `Unix Socket`,或者也可以启动一个独立的 `SSM` 服务。
## Composer
本项目可以使用composer安装,遵循psr-4自动加载规则,在你的 `composer.json` 中加入下面的内容:
```json
{
"require": {
"yurunsoft/swoole-shared-memory": "~1.0"
}
}
```
然后执行 `composer update` 安装。
## 文档
[API 文档](https://apidoc.gitee.com/yurunsoft/swoole-shared-memory) (感谢码云提供服务)
QQ群:17916227 [](https://jq.qq.com/?_wv=1027&k=5wXf4Zq),如有问题会有人解答和修复。
## 运行环境
- [PHP](https://php.net/) >= 7.1
- [Composer](https://getcomposer.org/)
- [Swoole](https://www.swoole.com/) >= 4.1.0
## 版权信息
Swoole Shared Memory 遵循 MIT 开源协议发布,并提供免费使用。
## 捐赠

开源不求盈利,多少都是心意,生活不易,随缘随缘……