From b2805a5e04644409286757f40b09a9da4f9e92de Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Mon, 6 Aug 2012 17:04:30 +0300 Subject: [PATCH] Rename OneConnPool to SingleConnPool. --- connpool.go | 14 +++++++------- pubsub.go | 2 +- redis.go | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/connpool.go b/connpool.go index c14ada94..361187a8 100644 --- a/connpool.go +++ b/connpool.go @@ -105,22 +105,22 @@ func (p *MultiConnPool) Len() int { //------------------------------------------------------------------------------ -type OneConnPool struct { +type SingleConnPool struct { conn *Conn } -func NewOneConnPool(conn *Conn) *OneConnPool { - return &OneConnPool{conn: conn} +func NewSingleConnPool(conn *Conn) *SingleConnPool { + return &SingleConnPool{conn: conn} } -func (p *OneConnPool) Get() (*Conn, bool, error) { +func (p *SingleConnPool) Get() (*Conn, bool, error) { return p.conn, false, nil } -func (p *OneConnPool) Add(conn *Conn) {} +func (p *SingleConnPool) Add(conn *Conn) {} -func (p *OneConnPool) Remove(conn *Conn) {} +func (p *SingleConnPool) Remove(conn *Conn) {} -func (p *OneConnPool) Len() int { +func (p *SingleConnPool) Len() int { return 1 } diff --git a/pubsub.go b/pubsub.go index 080ad09c..e9f95d14 100644 --- a/pubsub.go +++ b/pubsub.go @@ -20,7 +20,7 @@ func newPubSubClient(client *Client) (*PubSubClient, error) { c := &PubSubClient{ Client: &Client{ - ConnPool: NewOneConnPool(pubSubConn), + ConnPool: NewSingleConnPool(pubSubConn), }, ch: make(chan *Message), } diff --git a/redis.go b/redis.go index 01baf763..213367f4 100644 --- a/redis.go +++ b/redis.go @@ -88,7 +88,7 @@ func (c *Client) conn() (*Conn, error) { } if isNew && c.InitConn != nil { client := &Client{ - ConnPool: NewOneConnPool(conn), + ConnPool: NewSingleConnPool(conn), } err = c.InitConn(client) if err != nil {