2018-05-19 04:15:54 +03:00
|
|
|
package ants
|
2018-05-19 07:28:03 +03:00
|
|
|
|
2018-05-19 22:35:31 +03:00
|
|
|
const DEFAULT_POOL_SIZE = 5
|
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()
|
|
|
|
}
|