2017 © Pedro Peláez
 

library redis_retry

phpredis wrapper

image

jenner/redis_retry

phpredis wrapper

  • Tuesday, February 28, 2017
  • by huyanping
  • Repository
  • 2 Watchers
  • 4 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

RedisRetry

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

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., (*2)

here is an example:, (*3)

$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:, (*4)

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., (*5)

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, (*6)

The Versions

28/02 2017

dev-master

9999999-dev

phpredis wrapper

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

api wechat

28/02 2017

v0.2.0

0.2.0.0

phpredis wrapper

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

api wechat

15/05 2015

v0.1.0

0.1.0.0

phpredis wrapper

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

api wechat