gbatch

package
v0.0.0-...-3e416e1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

func NewBatchExecutor

func NewBatchExecutor() *Executor

func (*Executor) AppendTask

func (s *Executor) AppendTask(tasks ...task)

func (*Executor) SetPanicHandler

func (s *Executor) SetPanicHandler(panicHandler func(e interface{}))

func (*Executor) SetWorkers

func (s *Executor) SetWorkers(workersCnt int)

func (*Executor) WaitAll

func (s *Executor) WaitAll() (allResults []taskResult)

func (*Executor) WaitFirstDone

func (s *Executor) WaitFirstDone() (value interface{}, err error)

WaitFirstDone wait first done, value and err is the task returned.

func (*Executor) WaitFirstSuccess

func (s *Executor) WaitFirstSuccess() (value interface{}, err error)

WaitFirstSuccess wait first success, value is the first success task's returned value, if all task fail, err is the last error.

Jump to

Keyboard shortcuts

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