Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
A Pool is a set of objects that may be individually saved and retrieved.
Unlike Go's sync.Pool these objects are persistent and are not subject to be collected by the GC.
A Pool is safe for use by multiple goroutines simultaneously.
func New ¶
New creates a new Pool. Size sets the maximum number of objects the Pool can hold. If 'new' is set, 'new' will be called to allocate a new object when Get() is called on an empty Pool. If 'reset' is set, 'reset' will be called on the object returned by Get() if it was previously Put() in the Pool.
Click to show internal directories.
Click to hide internal directories.