pool

package
v0.0.0-...-5b64428 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 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 HandlerFunc

type HandlerFunc func(interface{}, error)

type Job

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

func MakeJobs

func MakeJobs(n int, process ProcessorFunc, handle HandlerFunc) []Job

func NewJob

func NewJob(process ProcessorFunc, handler HandlerFunc) Job

type Pool

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

func NewPool

func NewPool(jobs []Job, workers int) Pool

func (*Pool) Run

func (p *Pool) Run(ctx context.Context)

type ProcessorFunc

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

Jump to

Keyboard shortcuts

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