ants/ants.go

26 lines
337 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 20:38:50 +03:00
const DEFAULT_POOL_SIZE = 10000
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()
}