pool

package
v4.1.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 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 Pool

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

Pool is a basic work pool - I didn't like any of the ones I found, so I made one

func NewPool

func NewPool(routines int, job func(input interface{})) *Pool

NewPool creates a new worker pool with a goroutine limit and a job function to execute on the incoming data

func (*Pool) Wait

func (p *Pool) Wait()

Wait waits until the pool is finished

func (*Pool) Work

func (p *Pool) Work(c <-chan interface{})

Work is a blocking call that starts the pool working on a data input channel

Jump to

Keyboard shortcuts

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