worker

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	// 工作函数
	Func func(interface{})
	// 工作参数
	Params interface{}
}

type StartWorker

type StartWorker struct {
	// 最大运行数
	MaxSize    int `ini:"max_size"`
	WorkerPool chan chan Job
	// contains filtered or unexported fields
}

StartWorker 定义开始工作结构体

func (*StartWorker) Close

func (s *StartWorker) Close() error

Close 关闭所有worker

func (*StartWorker) Init

func (s *StartWorker) Init()

Init 初始化工作池

func (*StartWorker) Run

func (s *StartWorker) Run(j *Job)

Run 运行

Jump to

Keyboard shortcuts

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