ants/ants.go

22 lines
299 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 11:10:38 +03:00
const DEFAULT_POOL_SIZE = 1000
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()
}