forked from mirror/ants
update default settings of pool
This commit is contained in:
parent
76cc065dbc
commit
7f82498abc
12
ants.go
12
ants.go
|
@ -35,18 +35,8 @@ const (
|
||||||
DefaultCleanIntervalTime = 10
|
DefaultCleanIntervalTime = 10
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
|
||||||
defaultAntsPool *Pool
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
// Init a instance pool when importing ants
|
// Init a instance pool when importing ants
|
||||||
func init() {
|
var defaultAntsPool, _ = NewPool(DefaultAntsPoolSize)
|
||||||
defaultAntsPool, err = NewPool(DefaultAntsPoolSize)
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Submit submit a task to pool
|
// Submit submit a task to pool
|
||||||
func Submit(task f) error {
|
func Submit(task f) error {
|
||||||
|
|
Loading…
Reference in New Issue