jenner/redis_retry 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

jenner/redis_retry

最新稳定版本:v0.2.0

Composer 安装命令:

composer require jenner/redis_retry

包简介

phpredis wrapper

关键字:

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

A Redis wrapper which can retry to connect when the connection is closed by some reason. It will not affect other code. What you need to do is just adding 'use \Jenner\RedisRetry\Redis' in your code where you use the \Redis class.

here is an example:

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->select(1);
$redis->set('key', 'value');

add 'use \Jenner\RedisRetry\Redis' to the top of this php file:

use \Jenner\RedisRetry\Redis;

$redis = new Redis();
$redis->connect('127.0.0.1', 6379);
$redis->select(1);
$redis->set('key', 'value');

When we are running a php daemon process, it's possible that our program can not connect to the redis-server or the connection might be close for some reason that we don't know. The RedisRetry will reconnect to the redis-server when the connection is failed.

You can define two const to control the times to retry and the time to sleep(wait to retry the connection).

  • REDIS_RETRY_TIMES - The times to retry the connection.
  • REDIS_RETRY_DELAY - The time to sleep

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固