Redis Connection Pool Config

Redis Connection Pool Config

  • Swoole\Database\RedisConfig->withHost
  • Swoole\Database\RedisConfig->withPort
  • Swoole\Database\RedisConfig->withTimeout
  • Swoole\Database\RedisConfig->withReserved
  • Swoole\Database\RedisConfig->withRetryInterval
  • Swoole\Database\RedisConfig->withReadTimeout
  • Swoole\Database\RedisConfig->withAuth
  • Swoole\Database\RedisConfig->withDbIndex

    Swoole\Database\RedisConfig->withHost(string $host)
    Swoole\Database\RedisConfig->withPort(int $port)
    Swoole\Database\RedisConfig->withTimeout(float $timeout)
    Swoole\Database\RedisConfig->withReserved(string $reserved)
    Swoole\Database\RedisConfig->withRetryInterval(int $retry_interval)
    Swoole\Database\RedisConfig->withReadTimeout(float $read_timeout)
    Swoole\Database\RedisConfig->withAuth(string $auth)
    Swoole\Database\RedisConfig->withDbIndex(int $dbIndex)

    Example

    <?php
    (new RedisConfig)
        ->withHost('127.0.0.1')
        ->withPort(6379)
        ->withAuth('')
        ->withDbIndex(0)
        ->withTimeout(1)