diff --git a/ants_test.go b/ants_test.go index af7562b..8c2fa43 100644 --- a/ants_test.go +++ b/ants_test.go @@ -417,13 +417,13 @@ func TestPurgePreMalloc(t *testing.T) { } func TestRestCodeCoverage(t *testing.T) { - _, err := ants.NewTimingPool(-1, -1, false) + _, err := ants.NewUltimatePool(-1, -1, false) t.Log(err) - _, err = ants.NewTimingPool(1, -1, false) + _, err = ants.NewUltimatePool(1, -1, false) t.Log(err) - _, err = ants.NewTimingPoolWithFunc(-1, -1, demoPoolFunc, false) + _, err = ants.NewUltimatePoolWithFunc(-1, -1, demoPoolFunc, false) t.Log(err) - _, err = ants.NewTimingPoolWithFunc(1, -1, demoPoolFunc, false) + _, err = ants.NewUltimatePoolWithFunc(1, -1, demoPoolFunc, false) t.Log(err) p0, _ := ants.NewPool(TestSize) diff --git a/pool.go b/pool.go index e561c76..65bde25 100644 --- a/pool.go +++ b/pool.go @@ -104,16 +104,16 @@ func (p *Pool) periodicallyPurge() { // NewPool generates an instance of ants pool. func NewPool(size int) (*Pool, error) { - return NewTimingPool(size, DEFAULT_CLEAN_INTERVAL_TIME, false) + return NewUltimatePool(size, DEFAULT_CLEAN_INTERVAL_TIME, false) } // NewPoolPreMalloc generates an instance of ants pool with the memory pre-allocation of pool size. func NewPoolPreMalloc(size int) (*Pool, error) { - return NewTimingPool(size, DEFAULT_CLEAN_INTERVAL_TIME, true) + return NewUltimatePool(size, DEFAULT_CLEAN_INTERVAL_TIME, true) } -// NewTimingPool generates an instance of ants pool with a custom timed task. -func NewTimingPool(size, expiry int, preAlloc bool) (*Pool, error) { +// NewUltimatePool generates an instance of ants pool with a custom timed task. +func NewUltimatePool(size, expiry int, preAlloc bool) (*Pool, error) { if size <= 0 { return nil, ErrInvalidPoolSize } diff --git a/pool_func.go b/pool_func.go index d5ae85b..5085e78 100644 --- a/pool_func.go +++ b/pool_func.go @@ -107,16 +107,16 @@ func (p *PoolWithFunc) periodicallyPurge() { // NewPoolWithFunc generates an instance of ants pool with a specific function. func NewPoolWithFunc(size int, pf func(interface{})) (*PoolWithFunc, error) { - return NewTimingPoolWithFunc(size, DEFAULT_CLEAN_INTERVAL_TIME, pf, false) + return NewUltimatePoolWithFunc(size, DEFAULT_CLEAN_INTERVAL_TIME, pf, false) } // NewPoolWithFuncPreMalloc generates an instance of ants pool with a specific function and the memory pre-allocation of pool size. func NewPoolWithFuncPreMalloc(size int, pf func(interface{})) (*PoolWithFunc, error) { - return NewTimingPoolWithFunc(size, DEFAULT_CLEAN_INTERVAL_TIME, pf, true) + return NewUltimatePoolWithFunc(size, DEFAULT_CLEAN_INTERVAL_TIME, pf, true) } -// NewTimingPoolWithFunc generates an instance of ants pool with a specific function and a custom timed task. -func NewTimingPoolWithFunc(size, expiry int, pf func(interface{}), preAlloc bool) (*PoolWithFunc, error) { +// NewUltimatePoolWithFunc generates an instance of ants pool with a specific function and a custom timed task. +func NewUltimatePoolWithFunc(size, expiry int, pf func(interface{}), preAlloc bool) (*PoolWithFunc, error) { if size <= 0 { return nil, ErrInvalidPoolSize }