redis_connection_pool

package
v0.0.0-...-1222c1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2013 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionMode

type ConnectionMode int

What mode are we building the connection pool in?

const (
	LAZY ConnectionMode
	AGRESSIVE
)

How should we populate the connection pool?

type RedisConnection

type RedisConnection struct {
	Url string "Redis URL this factory will connect to"

	Logger *log4go.Logger "Handle to the logger we are using"
	// contains filtered or unexported fields
}

Connection Wrapper for Redis

func (*RedisConnection) Client

func (p *RedisConnection) Client() (*redis.Client, error)

Get a connection to Redis

func (*RedisConnection) Close

func (p *RedisConnection) Close(err error)

Close the connection to redis

func (*RedisConnection) IsClosed

func (p *RedisConnection) IsClosed() bool

Return true if the client connection exists

func (*RedisConnection) IsOpen

func (p *RedisConnection) IsOpen() bool

Return true if the client connection exists

func (*RedisConnection) Open

func (p *RedisConnection) Open() (err error)

Open a new connection to redis

func (*RedisConnection) Ping

func (p *RedisConnection) Ping() error

Ping the server, opening the client connection if necessary Returns:

nil   --> Ping was successful!
error --> Ping was failure

type RedisConnectionPool

type RedisConnectionPool struct {
	Mode   ConnectionMode "How should we prepare the connection pool?"
	Size   int            "(Max) Pool size"
	Urls   []string       "Redis URLs to connect to"
	Logger log4go.Logger  "Logger we are using in the connection pool"
	// contains filtered or unexported fields
}

Redis Connection Pool wrapper

func (*RedisConnectionPool) Close

func (p *RedisConnectionPool) Close()

Close the connection pool

func (*RedisConnectionPool) Open

func (p *RedisConnectionPool) Open() error

Open the connection pool

func (*RedisConnectionPool) Pop

Get a RedisConnection from the pool

func (*RedisConnectionPool) Push

Return a RedisConnection

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL