connpool

package
v0.0.0-...-726f7ef Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

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) Close

func (cp *ConnectionPool) Close() (err error)

Close ...

func (*ConnectionPool) Get

Get ...

func (*ConnectionPool) GetWithTimeout

func (cp *ConnectionPool) GetWithTimeout(d time.Duration) (rv *grpcutils.GrpcClientConn, err error)

GetWithTimeout ...

func (*ConnectionPool) Node

func (cp *ConnectionPool) Node() string

Node ...

func (*ConnectionPool) Return

func (cp *ConnectionPool) Return(c *grpcutils.GrpcClientConn)

Return ...

Jump to

Keyboard shortcuts

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