From a3265303686237e62d22da7738cba296e09d359d Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Sat, 21 Jul 2018 18:50:18 +0800 Subject: [PATCH] rename the monitorAndClear function --- pool.go | 4 ++-- pool_func.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pool.go b/pool.go index 1420c2e..8b87400 100644 --- a/pool.go +++ b/pool.go @@ -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 } diff --git a/pool_func.go b/pool_func.go index 6ba7817..b469b0e 100644 --- a/pool_func.go +++ b/pool_func.go @@ -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 }