Documentation ¶
Overview ¶
recycler
Index ¶
Constants ¶
View Source
const ( NewTimerDefaultDuration time.Duration = time.Minute TimerRecyclerBacklog int = 128 )
View Source
const (
BytebufRecyclerBacklog int = 128
)
Variables ¶
View Source
var BytebufRecycler = NewRecycler( BytebufRecyclerBacklog, func() interface{} { return bytes.NewBuffer(nil) }, "bytebuf_recycler", )
View Source
var RecyclerBacklogDefault int = 5
View Source
var RecyclerMgr = &recyclerMgr{ recyclers: make(map[interface{}]*Recycler), lock: new(sync.Mutex), }
View Source
var TimerRecycler = NewRecycler( TimerRecyclerBacklog, func() interface{} { return time.NewTimer(NewTimerDefaultDuration) }, "timer_recycler", )
Functions ¶
func AllocBytebuf ¶
func FreeBytebuf ¶
Types ¶
type Recycler ¶
type Recycler struct {
// contains filtered or unexported fields
}
func NewRecycler ¶
Click to show internal directories.
Click to hide internal directories.