mirror of
https://github.com/panjf2000/ants.git
synced 2025-12-19 20:31:04 +00:00
update -
This commit is contained in:
parent
dbc39db648
commit
2fef3ca1f7
@ -98,9 +98,9 @@ func main() {
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Submit tasks
|
## Submit tasks
|
||||||
Tasks can be submitted by calling `ants.Push(func())`
|
Tasks can be submitted by calling `ants.Submit(func())`
|
||||||
```go
|
```go
|
||||||
ants.Push(func() {})
|
ants.Submit(func() {})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Custom limited pool
|
## Custom limited pool
|
||||||
@ -110,7 +110,7 @@ Ants also supports custom limited pool. You can use the `NewPool` method to crea
|
|||||||
// set 10000 the size of goroutine pool
|
// set 10000 the size of goroutine pool
|
||||||
p, _ := ants.NewPool(10000)
|
p, _ := ants.NewPool(10000)
|
||||||
// submit a task
|
// submit a task
|
||||||
p.Push(func() {})
|
p.Submit(func() {})
|
||||||
```
|
```
|
||||||
|
|
||||||
## Readjusting pool capacity
|
## Readjusting pool capacity
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user