mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-16 18:11:03 +00:00
20 lines
279 B
Go
20 lines
279 B
Go
package ants
|
|
|
|
import "math"
|
|
|
|
const DEFAULT_POOL_SIZE = math.MaxInt32
|
|
|
|
var defaultPool = NewPool(DEFAULT_POOL_SIZE)
|
|
|
|
func Push(task f) error {
|
|
return defaultPool.Push(task)
|
|
}
|
|
|
|
func Size() int {
|
|
return int(defaultPool.Size())
|
|
}
|
|
|
|
func Cap() int {
|
|
return int(defaultPool.Cap())
|
|
}
|