pipe

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PipeAnyEnter

func PipeAnyEnter(inp <-chan Any, wg AnyWaiter) (out <-chan Any)

PipeAnyEnter returns a channel to receive all `inp` and registers throughput as arrival on the given `sync.WaitGroup` until close.

func PipeAnyLeave

func PipeAnyLeave(inp <-chan Any, wg AnyWaiter) (out <-chan Any)

PipeAnyLeave returns a channel to receive all `inp` and registers throughput as departure on the given `sync.WaitGroup` until close.

func TubeAnyEnter

func TubeAnyEnter(wg AnyWaiter) (tube func(inp <-chan Any) (out <-chan Any))

TubeAnyEnter returns a closure around PipeAnyEnter (_, wg) registering throughput on the given `sync.WaitGroup` as arrival.

func TubeAnyLeave

func TubeAnyLeave(wg AnyWaiter) (tube func(inp <-chan Any) (out <-chan Any))

TubeAnyLeave returns a closure around PipeAnyLeave (_, wg) registering throughput on the given `sync.WaitGroup` as departure.

Types

type Any

type Any generic.Type

Any is the generic type flowing thru the pipe network.

type AnyWaiter

type AnyWaiter interface {
	Add(delta int)
	Done()
}

AnyWaiter - as implemented by `*sync.WaitGroup` - attends Flapdoors and keeps track of how many enter and how many leave.

Use Your provided `*sync.WaitGroup.Wait()` to know when to close the facilities.

Just make sure to have _all_ entrances and exits attended, and don't `wg.Wait()` before You've flooded the facilities.

Jump to

Keyboard shortcuts

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