thread

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ParallelExecutor

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

ParallelExecutor 并行执行器

func NewParallelExecutor

func NewParallelExecutor() *ParallelExecutor

NewParallelExecutor 创建并行执行器

func (*ParallelExecutor) AddTask

func (pe *ParallelExecutor) AddTask(task ...Task) *ParallelExecutor

AddTask 添加任务

func (*ParallelExecutor) Execute

func (pe *ParallelExecutor) Execute(ctx context.Context) error

Execute 执行任务

func (*ParallelExecutor) SetParallelism

func (pe *ParallelExecutor) SetParallelism(p int) *ParallelExecutor

SetParallelism 设置并行度

func (*ParallelExecutor) SetRetries

func (pe *ParallelExecutor) SetRetries(n int) *ParallelExecutor

SetRetries 设置任务重试次数

func (*ParallelExecutor) SetTimeout

func (pe *ParallelExecutor) SetTimeout(d time.Duration) *ParallelExecutor

SetTimeout 设置任务超时时间

type Task

type Task func(context.Context) error

Task 任务

Jump to

Keyboard shortcuts

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