:return: Redis client
189258
def get_redis_client(self):
        
        host = self.config['host']
        ports = self.config['ports']
        sentinel_ports = self.config['sentinel_ports']
        sentinel_name = self.config['sentinel_name']
        password = self.config['password']
        databases = self.config['databases']

        if not isinstance(ports, list):
            ports = [ports]

        if not isinstance(sentinel_ports, list):
            sentinel_ports = [sentinel_ports]

        if sentinel_ports:
            assert len(sentinel_ports) == len(ports)
        else:
            sentinel_ports = [None for _ in xrange(len(ports))]

        for port, sentinel_port in izip(ports, sentinel_ports):
            for db in xrange(0, int(databases)):
                master = self.get_master(
                    host, port, sentinel_port, sentinel_name
                )
                pool = redis.ConnectionPool(
                    host=master[0], port=int(master[1]),
                    password=password, db=db
                )
                yield redis.Redis(connection_pool=pool), port, db
801044
def redis(self):
        
        redis_url = current_app.config.get("SSE_REDIS_URL")
        if not redis_url:
            redis_url = current_app.config.get("REDIS_URL")
        if not redis_url:
            raise KeyError("Must set a redis connection URL in app config.")
        return StrictRedis.from_url(redis_url)
905525
def fetch(self):
        
        raw = yield gen.Task(self._redis_client.get, self._key)
        if raw:
            self.loads(base64.b64decode(raw))
            raise gen.Return(True)
        raise gen.Return(False)
1367704
def slave_for(self, service):
        """"""
        # TODO: make it coroutine and connect minsize connections
        if service not in self._slaves:
            self._slaves[service] = ManagedPool(
                self, service, is_master=False,
                db=self._redis_db,
                password=self._redis_password,
                encoding=self._redis_encoding,
                minsize=self._redis_minsize,
                maxsize=self._redis_maxsize,
                ssl=self._redis_ssl,
                parser=self._parser_class,
                loop=self._loop)
        return self._slaves[service]
1088098
public IRedisClient getRedisClient(String host) {
        return getRedisClient(host, IRedisClient.DEFAULT_REDIS_PORT, null, null);
    }
361770
def create_redis_client(redis_address, password=None):
    
    redis_ip_address, redis_port = redis_address.split(":")
    # For this command to work, some other client (on the same machine
    # as Redis) must have run "CONFIG SET protected-mode no".
    return redis.StrictRedis(
        host=redis_ip_address, port=int(redis_port), password=password)
367365
function createClient(redisClientOptions) {
  const client = redis.createClient(redisClientOptions);
  if (!client._options) {
    client._options = redisClientOptions;
  }
  return client;
}
645128
def _get_client(self):
        
        kwargs = self._storage_parameters

        # Handles unsecure mode
        if self._unsecure:
            kwargs = kwargs.copy()
            kwargs['ssl_compression'] = False

        return _swift.client.Connection(**kwargs)
1195697
def get(key, profile=None):
    '''
    
    '''
    if not profile:
        return False
    redis_kwargs = profile.copy()
    redis_kwargs.pop('driver')
    redis_conn = redis.StrictRedis(**redis_kwargs)
    return redis_conn.get(key)
870237
def get_redis(**options):
    
    from uliweb import settings
    from uliweb.utils.common import log
    import redis
        
    options = (options or {})
    options.update(settings.REDIS)
    if 'unix_socket_path' in options:
        client = redis.Redis(unix_socket_path=options['unix_socket_path'])
    else:
        global __connection_pool__
    
        if not __connection_pool__ or __connection_pool__[0] != options['connection_pool']:
            d = {'host':'localhost', 'port':6379}
            d.update(options['connection_pool'])
            __connection_pool__ = (d, redis.ConnectionPool(**d))
        client = redis.Redis(connection_pool=__connection_pool__[1])
        
    if settings.REDIS.test_first:
        try:
            client.info()
        except Exception as e:
            log.exception(e)
            client = None
    return client
598649
def get(self, part):
        
        redis_key = ':'.join([self.namespace, self.key, part])

        objectType = self.conn.type(redis_key)
        if objectType == "string":
            self._data[part] = self.conn.get(redis_key)

        elif objectType == "list":
            self._data[part] = RedisList(redis_key, self.conn)

        else:
            raise RedisORMException("Other types besides string and list are unsupported at this time.")
1369956
function createClient(port, host, password) {
	var client = redis.createClient(port, host, {
		connect_timeout: false, // Never stop trying to connect to Redis...
		max_attempts: null, // ... no matter how many times it slaps us in the face.
		retry_max_delay: 5000, // Decay attempts to reconnect to a max of 5 seconds.
		enable_offline_queue: true // Queue up requests while we wait for a connection to re-establish.
	});

	client.on('error', function(err) {
		// Log the error, but don't quit. Our offline queue will keep us going until Redis comes back.
		log.error(err);
	});

	if (client && password) {
		client.auth(password);
	}

	return client;
}
165313
def _new_redis_client(self):
        
        if 'tornadoredis' not in globals():
            import tornadoredis
        kwargs = self._redis_connection_settings()
        LOGGER.info('Connecting to %(host)s:%(port)s DB %(selected_db)s',
                    kwargs)
        return tornadoredis.Client(**kwargs)
287285
def get_new_client(self, public=True):
        
        return self._get_client(public=public, cached=False)
499203
def connect(self):
        
        self.client = redis.Redis(
            host=self.host, port=self.port, password=self.password)
1248886
public static function redis()
    {
        // Detect when the PID of the current process has changed (from a fork, etc)
        // and force a reconnect to redis.
        $pid = getmypid();
        if (self::$pid !== $pid) {
            self::$redis = null;
            self::$pid = $pid;
        }

        if (!is_null(self::$redis)) {
            return self::$redis;
        }

        $server = self::$redisServer;
        if (empty($server)) {
            $server = 'localhost:6379';
        }

        if (is_array($server)) {
            require_once dirname(__FILE__) . '/Resque/RedisCluster.php';
            self::$redis = new Resque_RedisCluster($server);
        } else {
            if (strpos($server, 'unix:') === false) {
                list($host, $port) = explode(':', $server);
            } else {
                $host = $server;
                $port = null;
            }
            require_once dirname(__FILE__) . '/Resque/Redis.php';
            $redisInstance = new Resque_Redis($host, $port, self::$password);
            $redisInstance->prefix(self::$namespace);
            self::$redis = $redisInstance;
        }

        if (!empty(self::$redisDatabase)) {
            self::$redis->select(self::$redisDatabase);
        }

        return self::$redis;
    }
1151151
function connect() {
    if (!redis) {
      debug('createClient ' + key + ' at ' + host + ':' + port);
      redis = redisLib.createClient(port, host, redisOpts); }
  }