Merge branch 'develop'

This commit is contained in:
Andy Pan 2018-07-21 18:50:58 +08:00
commit 7fb8ca409b
2 changed files with 4 additions and 4 deletions

View File

@ -61,7 +61,7 @@ type Pool struct {
once sync.Once
}
func (p *Pool) monitorAndClear() {
func (p *Pool) periodicallyPurge() {
heartbeat := time.NewTicker(p.expiryDuration)
go func() {
for range heartbeat.C {
@ -110,7 +110,7 @@ func NewTimingPool(size, expiry int) (*Pool, error) {
release: make(chan sig, 1),
expiryDuration: time.Duration(expiry) * time.Second,
}
p.monitorAndClear()
p.periodicallyPurge()
return p, nil
}

View File

@ -62,7 +62,7 @@ type PoolWithFunc struct {
once sync.Once
}
func (p *PoolWithFunc) monitorAndClear() {
func (p *PoolWithFunc) periodicallyPurge() {
heartbeat := time.NewTicker(p.expiryDuration)
go func() {
for range heartbeat.C {
@ -112,7 +112,7 @@ func NewTimingPoolWithFunc(size, expiry int, f pf) (*PoolWithFunc, error) {
expiryDuration: time.Duration(expiry) * time.Second,
poolFunc: f,
}
p.monitorAndClear()
p.periodicallyPurge()
return p, nil
}