worker

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2019 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 Func

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

func (Func) Run

func (f Func) Run() (interface{}, error)

type Job

type Job interface {
	Run() (interface{}, error)
}

type JobGenerator

type JobGenerator interface {
	GetJob() Job
}

type Pool

type Pool interface {
	StartJob(Job) future.Future
	RunJob(Job) (interface{}, error)
	RunJobs(JobGenerator) ([]interface{}, error)

	Start()
	Stop()
}

func NewPool

func NewPool(size PoolSize) Pool

type PoolSize

type PoolSize int
const SizeAuto PoolSize = 0

Jump to

Keyboard shortcuts

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