async

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultWorkerNum = runtime.GOMAXPROCS(0) * 2

DefaultWorkerNum default number of goroutines is twice the number of GOMAXPROCS

Functions

This section is empty.

Types

type Executor added in v1.8.0

type Executor[R any] interface {
	AddTask(task Task[R])
	Result() <-chan Result[R]
}

Executor interface

func NewExec added in v1.8.0

func NewExec[R any](maxWorkerNum int) Executor[R]

NewExec ...

type Result added in v1.8.0

type Result[R any] struct {
	Value R
	Err   error
}

Result ...

type Task

type Task[R any] func() (R, error)

Task task func

Jump to

Keyboard shortcuts

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