Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // URL is used to connect to Redis. URL string // LongPollTimeout is the timeout in seconds for the BRPOP Redis command that reads from the queues. Zero means no // timeout, but it is better that you set a value, because it also has the effect of pinging the connection, to make // sure it is still active. LongPollTimeout int // MaxIdle is a parameter for redis.Pool. MaxIdle int // MaxActive is a parameter for redis.Pool. MaxActive int // IdleTimeout is a parameter for redis.Pool. IdleTimeout time.Duration // ReadTimeout is a parameter for redis.DialReadTimeout. ReadTimeout time.Duration // WriteTimeout is a parameter for redis.DialWriteTimeout. WriteTimeout time.Duration }
Config holds the configuration for Redis connections.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig returns the default configuration.
type ConnManager ¶
type ConnManager struct {
// contains filtered or unexported fields
}
ConnManager implements the ConnProvider interface and encapsulates the process of establishing and configuring Redis connections. The non-dedicated connections use redis.Pool.
func NewConnManager ¶
func NewConnManager(cfg *Config) *ConnManager
NewConnManager returns a new instance. Make sure to call Close when you are done.
func (*ConnManager) Close ¶
func (cm *ConnManager) Close() error
Close releases resources used by the connection pool.
func (*ConnManager) DialLongPoll ¶
DialLongPoll implements ConnProvider.
Click to show internal directories.
Click to hide internal directories.