async

package
v0.0.0-...-cbf8372 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: AGPL-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 AsyncResult

type AsyncResult struct {
	Value interface{}
	Err   error
}

AsyncResult result struct

type IAsync

type IAsync interface {
	AddTask(task Task)
	Result() <-chan AsyncResult
}

IAsync interface

func NewAsync

func NewAsync(maxWorkerNum int) IAsync

NewAsync ...

type Task

type Task func() (interface{}, error)

Task task func

Jump to

Keyboard shortcuts

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