func (p *Pool) Size() int {
	return len(p.connections)
}
Size returns how many instances the pool sits over. Useful for ranging
over with WithIndex.
package pool
import (
	"fmt"
	"time"
	"github.com/garyburd/redigo/redis"
)
type Pool struct {
	connections []*connectionPool
	hash        func(string) uint32
}
func New(
	addresses []string,
	connectTimeout, readTimeout, writeTimeout time.Duration,
	maxConnectionsPerInstance int,
	hash func(string) uint32,
) *Pool {
	connections := make([]*connectionPool, len(addresses))
	for i, address := range addresses {
		connections[i] = newConnectionPool(
			address,
			connectTimeout, readTimeout, writeTimeout,
			maxConnectionsPerInstance,
		)
	}
	return &Pool{
		connections: connections,
		hash:        hash,
	}
}
func (p *Pool) Index(key string) int {
	return int(p.hash(key) % uint32(len(p.connections)))
}