定制 easyswoole/fast-cache 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

easyswoole/fast-cache

最新稳定版本:2.0.1

Composer 安装命令:

composer require easyswoole/fast-cache

包简介

An efficient swoole framework

README 文档

README

EasySwoole FastCache组件通过新开进程,使用SplArray存储,unix sock 高速通信方式,实现了多进程共享数据.

示例代码

use EasySwoole\FastCache\Cache;

require 'vendor/autoload.php';


$http = new swoole_http_server("127.0.0.1", 9501);

Cache::getInstance()->attachToServer($http);


$http->on("request", function ($request, $response) {
    $res = Cache::getInstance()->set('easyswoole', 'easyswoole');
    var_dump($res);
    $res = Cache::getInstance()->get('easyswoole');
    $response->end($res);
});

$http->start();

内存问题

数据分散在进程内,一个进程可能需要占用很大的内存,因此请根据实际业务量配置内存大小。

单元测试

服务启动

php example.php

执行测试用例

 php vendor/bin/co-phpunit tests

统计信息

  • 总下载量: 30.09k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 10
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 10
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2018-12-27