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: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForkAnySeen

func ForkAnySeen(inp <-chan Any) (new, old <-chan Any)

ForkAnySeen returns two channels, `new` and `old`, where `new` is to receive all `inp` not been seen before and `old` all `inp` seen before (internally growing a `sync.Map` to discriminate) until close.

func ForkAnySeenAttr

func ForkAnySeenAttr(inp <-chan Any, attr func(a Any) interface{}) (new, old <-chan Any)

ForkAnySeenAttr returns two channels, `new` and `old`, where `new` is to receive all `inp` whose attribute `attr` has not been seen before and `old` all `inp` seen before (internally growing a `sync.Map` to discriminate) until close.

func PipeAnySeen

func PipeAnySeen(inp <-chan Any) (out <-chan Any)

PipeAnySeen returns a channel to receive all `inp` not been seen before while silently dropping everything seen before (internally growing a `sync.Map` to discriminate) until close.

Note: PipeAnyFilterNotSeenYet might be a better name, but is fairly long.

func PipeAnySeenAttr

func PipeAnySeenAttr(inp <-chan Any, attr func(a Any) interface{}) (out <-chan Any)

PipeAnySeenAttr returns a channel to receive all `inp` whose attribute `attr` has not been seen before while silently dropping everything seen before (internally growing a `sync.Map` to discriminate) until close.

Note: PipeAnyFilterAttrNotSeenYet might be a better name, but is fairly long.

func TubeAnySeen

func TubeAnySeen() (tube func(inp <-chan Any) (out <-chan Any))

TubeAnySeen returns a closure around PipeAnySeen() (silently dropping every Any seen before).

func TubeAnySeenAttr

func TubeAnySeenAttr(attr func(a Any) interface{}) (tube func(inp <-chan Any) (out <-chan Any))

TubeAnySeenAttr returns a closure around PipeAnySeenAttr() (silently dropping every Any whose attribute `attr` was seen before).

Types

type Any

type Any generic.Type

Any is the generic type flowing thru the pipe network.

Jump to

Keyboard shortcuts

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