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
}
*
- Fixed size Object pool
func NewFixedPool ¶
func NewFixedPool(capacity int, factory PooledObjectFactory) *FixedPool
Creates a new fixed pool with capacity
func (*FixedPool) Get ¶
func (p *FixedPool) Get() (PooledObject, error)
func (*FixedPool) Return ¶
func (p *FixedPool) Return(obj PooledObject) error
type Pool ¶
type Pool interface { Get() (PooledObject, error) Return(obj PooledObject) error }
All pool implementations must satisfy this interface
type PooledObject ¶
type PooledObject interface {
Reset()
}
type PooledObjectFactory ¶
type PooledObjectFactory interface {
Create() (PooledObject, error)
}
All pooled object factories must satisfy this interface
Click to show internal directories.
Click to hide internal directories.