workpool

package
v0.0.0-...-9f09256 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: GPL-2.0 Imports: 0 Imported by: 0

README

简介

workpool
限流器

使用

  • 开启调度
# work_num 任务并发数(工作数)
dispathcher := NewDispathcher(num int)
  • 加入 job
# job 接口
dispathcher.AddJob(job)
  • 关闭调度
dispathcher.Stop()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDispathcher

func NewDispathcher(num int) *dispathcherImpl

Types

type Dispathcher

type Dispathcher interface {
	AddJob(Job)
	Stop()
}

type Job

type Job interface {
	Execute()
}

Jump to

Keyboard shortcuts

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