Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Pool ¶
type Pool struct {
// Maximum size of the pool.
Size uint
// Release factor (RF) value and internal counter.
// RF is a value that indicates how big part of items should be released even if pool may store them.
// This feature need for gradual refresh of pool data and avoid to bloating objects stored in the pool.
// RF should be in range [0.0, 1.0]. Note, that RF value around or equal 1.0 is senseless since in that case poll
// will store only small piece of the data.
// Usually RF <= 0.05 is enough.
ReleaseFactor float32
// Function to make new object if pool didn't deliver existing.
New func() interface{}
// contains filtered or unexported fields
}
A Pool is a set of temporary objects. Object must implement release logic.
Click to show internal directories.
Click to hide internal directories.