Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Pool ¶
type Pool interface { // Sync 同步模式:没有闲置协程时会等待 // // 通常需要 context.WithoutCancel(ctx) Sync(ctx context.Context, fn func(ctx context.Context)) // Async 异步模式:没有闲置协程时会放人全局链表缓存 // // 通常需要 context.WithoutCancel(ctx) Async(ctx context.Context, fn func(ctx context.Context)) // Close 关闭资源 Close() }
Pool 协程并发复用,降低CPU和内存负载
Click to show internal directories.
Click to hide internal directories.