queue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(workers int, jobs <-chan Job, results chan<- Result)

Start creates worker goroutines and starts waiting for jobs to come through. Close the jobs channel to stop the queue, all existing jobs will be processed. After all workers have finished, the results channel will be closed.

Types

type Job

type Job interface {
	Run() Result
}

type Jobs

type Jobs chan Job

type Result

type Result interface {
	Err() error
}

type Results

type Results chan Result

Jump to

Keyboard shortcuts

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