async

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Task

type Task struct {
	Err    error
	Result interface{}
	// contains filtered or unexported fields
}

a task wraps a function and its response

func NewTask

func NewTask(f func() (interface{}, error)) *Task

func (*Task) Run

func (t *Task) Run()

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool() *WorkerPool

func NewWorkerPoolWithSize

func NewWorkerPoolWithSize(size int) *WorkerPool

func (*WorkerPool) AddTask

func (p *WorkerPool) AddTask(taskFunc func() (interface{}, error))

func (*WorkerPool) GetTasks

func (p *WorkerPool) GetTasks() []*Task

func (*WorkerPool) StopWait

func (p *WorkerPool) StopWait()

Jump to

Keyboard shortcuts

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