Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FixedPool ¶
type FixedPool struct {
// contains filtered or unexported fields
}
A FixedPool like sync.Pool. But it's limited capacity. When pool is full, Put will abandon and call destroyFunc to destroy the object.
func (*FixedPool) Get ¶
Get selects an arbitrary item from the pool, removes it from the pool, and returns it to the caller. Get may choose to ignore the pool and treat it as empty. Callers should not assume any relation between values passed to Put and the values returned by Get.
If pool is empty, Get returns the result of calling newFunc.
Click to show internal directories.
Click to hide internal directories.