Documentation
¶
Index ¶
- func PipeAnyEnter(inp <-chan Any, wg AnyWaiter) (out <-chan Any)
- func PipeAnyLeave(inp <-chan Any, wg AnyWaiter) (out <-chan Any)
- func TubeAnyEnter(wg AnyWaiter) (tube func(inp <-chan Any) (out <-chan Any))
- func TubeAnyLeave(wg AnyWaiter) (tube func(inp <-chan Any) (out <-chan Any))
- type Any
- type AnyWaiter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PipeAnyEnter ¶
PipeAnyEnter returns a channel to receive all `inp` and registers throughput as arrival on the given `sync.WaitGroup` until close.
func PipeAnyLeave ¶
PipeAnyLeave returns a channel to receive all `inp` and registers throughput as departure on the given `sync.WaitGroup` until close.
func TubeAnyEnter ¶
TubeAnyEnter returns a closure around PipeAnyEnter (_, wg) registering throughput on the given `sync.WaitGroup` as arrival.
func TubeAnyLeave ¶
TubeAnyLeave returns a closure around PipeAnyLeave (_, wg) registering throughput on the given `sync.WaitGroup` as departure.
Types ¶
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.