rp

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatStop    = 0
	StatRunning = 1
	StatPause   = 2

	ExecMajor = int8(0)
	ExecMinor = int8(1)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RoutinePool

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

func NewRp added in v0.2.0

func NewRp(concurrency int) (*RoutinePool, error)

NewRp 从协程池对象池中取出一个并发数为concurrency的rp

func (*RoutinePool) Clear

func (p *RoutinePool) Clear()

Clear 清空任务队列

func (*RoutinePool) GetSingleResult

func (p *RoutinePool) GetSingleResult() *fuzzTypes.Reaction

GetSingleResult 获取单个任务结果

func (*RoutinePool) Pause

func (p *RoutinePool) Pause()

Pause 暂停调度

func (*RoutinePool) RegisterExecutor added in v0.2.0

func (p *RoutinePool) RegisterExecutor(executor func(*fuzzCtx.TaskCtx) *fuzzTypes.Reaction, which int8)

RegisterExecutor 注册任务执行函数,如果协程池是运行状态,或注册下标不为ExecMinor或ExecMajor,则退出 特别注意:协程池在运行状态时是不能调用此函数的,必须先暂停

func (*RoutinePool) ReleaseSelf added in v0.2.0

func (p *RoutinePool) ReleaseSelf()

ReleaseSelf 将自身放入池中

func (*RoutinePool) Resize

func (p *RoutinePool) Resize(size int)

func (*RoutinePool) Resume

func (p *RoutinePool) Resume()

Resume 恢复调度

func (*RoutinePool) Start

func (p *RoutinePool) Start()

Start 启动所有 worker

func (*RoutinePool) Status

func (p *RoutinePool) Status() int8

func (*RoutinePool) Stop

func (p *RoutinePool) Stop()

Stop 关闭管道,停止所有 worker

func (*RoutinePool) Submit

func (p *RoutinePool) Submit(execArg *fuzzCtx.TaskCtx, whichExec int8, timeout time.Duration) bool

Submit 添加任务

func (*RoutinePool) Wait

func (p *RoutinePool) Wait(maxTime time.Duration) bool

Wait 等待协程池若干时间

func (*RoutinePool) WaitResume added in v0.2.0

func (p *RoutinePool) WaitResume()

Jump to

Keyboard shortcuts

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