Documentation
¶
Overview ¶
Package parallel 提供仅依赖 context 与 Go runtime 的有序批处理并发基础设施。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForEach ¶
ForEach 在当前运行时可用并行度内处理每个索引。work 负责把各索引的业务失败写入 自己的结果槽,避免一个作品失败取消同一批的其他作品;context 取消仍立即停止派发。
func SystemWorkerCount ¶
func SystemWorkerCount() int
SystemWorkerCount 采用当前 GOMAXPROCS;它会尊重容器 CPU quota、运行时环境和 调用��对 Go scheduler 的显式设置,不暴露 pixiv-cli 自己的并发配置或硬编码上限。
func WorkerCount ¶
WorkerCount 将系统可用并发收敛到本批任务数,既不创建空 worker,也不以固定数字 限制用户的下载任务。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.