ants/ants.go

20 lines
282 B
Go
Raw Normal View History

2018-05-19 04:15:54 +03:00
package ants
2018-05-19 07:28:03 +03:00
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 {
2018-05-19 07:57:01 +03:00
return int(defaultPool.Running())
2018-05-19 07:28:03 +03:00
}
func Cap() int {
return int(defaultPool.Cap())
}