workerpool

package
v0.0.0-...-30b4b00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(workers, queueSize int)

Init 初始化全局 Worker Pool

func Shutdown

func Shutdown()

Shutdown 优雅关闭,等待所有任务完成

func Submit

func Submit(task Task)

Submit 提交异步任务(非阻塞,队列满时丢弃并打印警告)

Types

type Pool

type Pool struct {
	// contains filtered or unexported fields
}

Pool 轻量级 Worker Pool

type Task

type Task func(ctx context.Context)

Task 异步任务函数类型

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL