Documentation ¶
Index ¶
- Variables
- type ConnectionPool
- func (cp *ConnectionPool) Close() (err error)
- func (cp *ConnectionPool) Get() (*grpcutils.GrpcClientConn, error)
- func (cp *ConnectionPool) GetWithTimeout(d time.Duration) (rv *grpcutils.GrpcClientConn, err error)
- func (cp *ConnectionPool) Node() string
- func (cp *ConnectionPool) Return(c *grpcutils.GrpcClientConn)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTimeout = errors.New("timeout waiting to build connection")
ErrTimeout is the error we send when we timeout while waiting for a connection to be created
Functions ¶
This section is empty.
Types ¶
type ConnectionPool ¶
type ConnectionPool struct {
// contains filtered or unexported fields
}
ConnectionPool Channels as a Pool the connections channel practically does all the work here getting a connection from the pool is read from the channel if it the first time we try to get connection, or all connections are in use makeConn creates a new one returning a connection is a non-blocking send back into the channel
func NewConnectionPool ¶
func NewConnectionPool(host string, closer bool, poolSize, poolOverflow int, tracing bool) *ConnectionPool
NewConnectionPool builds a new connection pool
func (*ConnectionPool) Get ¶
func (cp *ConnectionPool) Get() (*grpcutils.GrpcClientConn, error)
Get ...
func (*ConnectionPool) GetWithTimeout ¶
func (cp *ConnectionPool) GetWithTimeout(d time.Duration) (rv *grpcutils.GrpcClientConn, err error)
GetWithTimeout ...
func (*ConnectionPool) Return ¶
func (cp *ConnectionPool) Return(c *grpcutils.GrpcClientConn)
Return ...
Click to show internal directories.
Click to hide internal directories.