Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanFunction ¶
type CleanFunction = func()
type GetNewItem ¶
type GetNewItem = func(OnItemBorken) (*Item, error)
get new item and can know the moment when it brokes
type Item ¶
type Item struct { Resouce interface{} // keep Resouce Clean CleanFunction // Clean Resouce TODO with DLB }
type OnItemBorken ¶
type OnItemBorken = func()
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
define pool data structure
func GetPool ¶
func GetPool(getNewItem GetNewItem, size int, duration time.Duration, retryDuration time.Duration) *Pool
get a pool, need to provide:
(1) getNewItem: how to get a new item (2) size (3) duration to get a new item
func (*Pool) GetItemNum ¶
Click to show internal directories.
Click to hide internal directories.