chanworker

package
v0.0.0-...-016f308 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

func NewWorker(nWorkers int, fn func(el interface{}, ok bool)) chan<- interface{}

NewWorker starts nWorkers goroutines running fn on incoming items sent on the returned channel. fn may block; writes to the channel will buffer. If nWorkers is negative, a new goroutine running fn is called for each item sent on the returned channel. When the returned channel is closed, fn is called with (nil, false) after all other calls to fn have completed. If nWorkers is zero, NewWorker will panic.

Types

This section is empty.

Jump to

Keyboard shortcuts

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