package
Version:
v0.9.2
Opens a new window with list of versions in this module.
Published: Dec 1, 2025
License: Apache-2.0
Opens a new window with license information.
Imports: 5
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
1. 多协程并发执行时,一个协程抛出panic会导致所有协程全部退出,一个协程的panic只能该协程调用recover捕获,所以每个协程都要执行defer func() { recover() }()
2. 如果我们有批量的任务需要执行,肯定通过并发调用来提高性能,同时我们不希望其中一个调用失败就导致所有的任务都退出,而是要继续执行完其它的任务,封装co.GoAndWait接口
func NewPool(poolCapacity int, printf func(formatter string, args ...any)) *Pool
func (pool *Pool) Close()
func (pool *Pool) Go(fn func(...any), args ...any)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.