pipe

package
v0.0.0-...-e9fe98c Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package pipe is adapted from https://github.com/rheinardkorf/go-concurrency/blob/master/11_pipeline_complex/pipe/pipe.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pipe

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

Pipe represents a pipe that contains multiple processes.

func New

func New() *Pipe

New creates a new Pipe and then runs the init() method which sets a cancelable context.

func WithProcesses

func WithProcesses(procs ...process.Processor) *Pipe

WithProcesses creates a new Pipe, but accepts a slice of Processors to run later.

func (*Pipe) AddProcess

func (p *Pipe) AddProcess(proc process.Processor) error

AddProcess adds a single process to the processes slice.

func (*Pipe) AddProcesses

func (p *Pipe) AddProcesses(procs ...process.Processor) error

AddProcesses adds a multiple processes to the processes slice.

func (*Pipe) Run

func (p *Pipe) Run(errc *chan error) error

Run iterates over the processes slice and starts each process.

Jump to

Keyboard shortcuts

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