task

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor[T any] struct {
	// contains filtered or unexported fields
}

func NewTaskExecutor

func NewTaskExecutor[T any]() *Executor[T]

func NewTaskExecutorWithBuffer

func NewTaskExecutorWithBuffer[T any](bufferSize int) *Executor[T]

func (*Executor[T]) AddTask

func (t *Executor[T]) AddTask(c context.Context, task func(context.Context) (T, error))

func (*Executor[T]) Results

func (t *Executor[T]) Results() Results[T]

func (*Executor[T]) Wait

func (t *Executor[T]) Wait()

type Result

type Result[T any] struct {
	Value T
	Error error
}

type Results

type Results[T any] struct {
	Values []Result[T]
}

func (Results[T]) AnyError

func (r Results[T]) AnyError() error

Jump to

Keyboard shortcuts

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