ants/ants.go

28 lines
360 B
Go
Raw Normal View History

2018-05-19 04:15:54 +03:00
package ants
2018-05-19 07:28:03 +03:00
2018-05-19 13:24:36 +03:00
import "math"
const DEFAULT_POOL_SIZE = math.MaxInt32
2018-05-19 07:28:03 +03:00
var defaultPool = NewPool(DEFAULT_POOL_SIZE)
func Push(task f) error {
return defaultPool.Push(task)
}
2018-05-19 10:22:14 +03:00
func Running() int {
return defaultPool.Running()
2018-05-19 07:28:03 +03:00
}
func Cap() int {
2018-05-19 10:22:14 +03:00
return defaultPool.Cap()
2018-05-19 07:28:03 +03:00
}
2018-05-19 10:22:14 +03:00
func Free() int {
return defaultPool.Free()
}
2018-05-19 13:24:36 +03:00
func Wait() {
defaultPool.Wait()
}