'options' => [
...
// The default amount of time (in seconds) the client waits before
// determining that a connection attempt to a Sentinel server failed.
'sentinel_timeout' => 0.100,
// The default number of attempts to retry a command when the client fails
// to connect to a Redis or Sentinel server. A value of 0 instructs the
// client to throw an exception after the first failed attempt, while a
// value of -1 causes the client to continue to retry commands indefinitely.
'retry_limit' => 20,
// The default amount of time (in milliseconds) that the client waits before
// attempting to contact another Sentinel server or retry a command if the
// previous server did not respond.
'retry_wait' => 1000,
// Instructs the client to query the first reachable Sentinel server for an
// updated set of Sentinels each time the client needs to establish a
// connection with a Redis master or replica.
'update_sentinels' => false,
],
// Uses the 'default' connection defined in the 'redis-sentinel' config block:
RedisSentinel::get('some-key');
app('redis-sentinel')->get('some-key');
// Uses the 'default' connection defined in the standard 'redis' config block:
Redis::get('some-key');
app('redis')->get('some-key');
use Monospice\LaravelRedisSentinel\Contracts\Factory as RedisSentinel;
...
public function __construct(RedisSentinel $sentinel)
{
$sentinel->get('some-key');
}
use Illuminate\Contracts\Redis\Factory as Redis;
...
public function __construct(Redis $redis)
{
// Either a Sentinel connection or a standard Redis connection depending on
// the value of REDIS_DRIVER or config('database.redis.driver'):
$redis->get('some-key');
}