async

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobResult

type JobResult struct {
	Input  any
	Output any
	Err    error
}

JobResult is the result of a single job.

type ProcessResult

type ProcessResult struct {
	Results  []JobResult
	HasError bool
}

ProcessResult is the result of a list of jobs, the hasError flag indicates if any job has failed.

func (*ProcessResult) GetErrors added in v0.2.0

func (p *ProcessResult) GetErrors() (errs []error)

GetErrors return all errors from failed jobs, it uses HasError flag to minimize allocations on getting errors

type Processor

type Processor[I any, O any] interface {
	Process([]I) ProcessResult
	Close()
}

Processor is a generic interface to process asynchronously a list of inputs.

Jump to

Keyboard shortcuts

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