Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrClosed = errors.New("pool is closed") ErrConfigInvalid = errors.New("config is invalid") )
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool interface { // Get return a new item from the pool. Closing the item puts it back to the pool Get() (net.Conn, error) // Close close the pool and release all resources Close() // Len returns the number of items of the pool Len() int }
func NewHeapPool ¶
func NewHeapPool(config *PoolConfig) (Pool, error)
type PoolConfig ¶
type PoolConn ¶
func (*PoolConn) IsUnusable ¶
func (*PoolConn) MarkUnusable ¶
func (pc *PoolConn) MarkUnusable()
type PriorityQueue ¶
type PriorityQueue []*PoolConn
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.