mirror of https://github.com/panjf2000/ants.git
Document Reboot()
This commit is contained in:
parent
d32d668565
commit
67766a5661
|
@ -291,7 +291,15 @@ p, _ := ants.NewPool(100000, ants.WithPreAlloc(true))
|
|||
pool.Release()
|
||||
```
|
||||
|
||||
### Reboot Pool
|
||||
|
||||
```go
|
||||
// A pool that has been released can be still used once you invoke the Reboot().
|
||||
pool.Reboot()
|
||||
```
|
||||
|
||||
## ⚙️ About sequence
|
||||
|
||||
All tasks submitted to `ants` pool will not be guaranteed to be addressed in order, because those tasks scatter among a series of concurrent workers, thus those tasks would be executed concurrently.
|
||||
|
||||
## 🧲 Benchmarks
|
||||
|
|
|
@ -292,7 +292,14 @@ p, _ := ants.NewPool(100000, ants.WithPreAlloc(true))
|
|||
pool.Release()
|
||||
```
|
||||
|
||||
### 关于任务执行顺序
|
||||
### Reboot Pool
|
||||
|
||||
```go
|
||||
// 只要调用 Reboot() 方法,就可以重新激活一个之前已经被销毁掉的池,并且投入使用。
|
||||
pool.Reboot()
|
||||
```
|
||||
|
||||
## ⚙️ 关于任务执行顺序
|
||||
|
||||
`ants` 并不保证提交的任务被执行的顺序,执行的顺序也不是和提交的顺序保持一致,因为在 `ants` 是并发地处理所有提交的任务,提交的任务会被分派到正在并发运行的 workers 上去,因此那些任务将会被并发且无序地被执行。
|
||||
|
||||
|
|
Loading…
Reference in New Issue