Documentation
¶
Index ¶
Constants ¶
View Source
const MaxConnectCount = 20000
View Source
const MaxIdleConnectCount = 25000
Variables ¶
View Source
var (
ErrClosed = errors.New("pool is closed")
)
Functions ¶
This section is empty.
Types ¶
type Connex ¶
func (*Connex) Close ¶
Close put the connection back to pool if possible. Executed by multi times is ok.
func (*Connex) IsUnusable ¶
func (*Connex) MarkUnusable ¶
func (c *Connex) MarkUnusable()
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 NewConnexPool ¶
func NewConnexPool(cfg PoolConfig) (Pool, error)
type PoolConfig ¶
type PriorityQueue ¶
type PriorityQueue []*Connex
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.