rp

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type RoutinePool

type RoutinePool struct {
	// contains filtered or unexported fields
}
var CurrentRp *RoutinePool

func New

func New(concurrency int) *RoutinePool

New 创建一个新的协程池

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) 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(task Task, timeout time.Duration) bool

Submit 添加任务

func (*RoutinePool) Wait

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

Wait 等待协程池若干时间

type Task

type Task func() *fuzzTypes.Reaction

Jump to

Keyboard shortcuts

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