Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ReferenceCountable ¶
type ReferenceCountable interface { SetInstance(i interface{}) IncrementReferenceCount() DecrementReferenceCount() }
ReferenceCountable ...
type ReferenceCountedPool ¶
type ReferenceCountedPool struct {
// contains filtered or unexported fields
}
ReferenceCountedPool Struct representing the pool
func NewReferenceCountedPool ¶
func NewReferenceCountedPool(factory func(referenceCounter ReferenceCounter) ReferenceCountable, reset func(interface{}) error) *ReferenceCountedPool
NewReferenceCountedPool Method to create a new pool
func (*ReferenceCountedPool) Get ¶
func (p *ReferenceCountedPool) Get() ReferenceCountable
Get Method to get new object
func (*ReferenceCountedPool) Stats ¶
func (p *ReferenceCountedPool) Stats() map[string]interface{}
Stats Method to return reference counted pool stats
type ReferenceCounter ¶
type ReferenceCounter struct {
// contains filtered or unexported fields
}
ReferenceCounter ...
func (ReferenceCounter) DecrementReferenceCount ¶
func (r ReferenceCounter) DecrementReferenceCount()
DecrementReferenceCount Method to decrement a reference If the reference count goes to zero, the object is put back inside the pool
func (ReferenceCounter) IncrementReferenceCount ¶
func (r ReferenceCounter) IncrementReferenceCount()
IncrementReferenceCount Method to increment a reference
func (*ReferenceCounter) SetInstance ¶
func (r *ReferenceCounter) SetInstance(i interface{})
SetInstance Method to set the current instance
Click to show internal directories.
Click to hide internal directories.