runner

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Broadcast added in v0.6.0

func Broadcast(p Pool, pipeID string, sinks []Sink, cancel <-chan struct{}, in <-chan Message) []<-chan error

Broadcast passes messages to all sinks.

Types

type Hook added in v0.5.1

type Hook func(string) error

Hook represents optional functions for components lyfecycle.

type Hooks

type Hooks struct {
	Flush     Hook
	Interrupt Hook
	Reset     Hook
}

Hooks is the set of components Hooks for runners.

type Message

type Message struct {
	SinkRefs int32          // number of sinks referencing buffer in this message.
	PipeID   string         // ID of pipe which spawned this message.
	Buffer   signal.Float64 // Buffer of message.
	Params   state.Params   // params for pipe.
}

Message is a main structure for pipe transport

type Pool added in v0.6.0

type Pool interface {
	Alloc() signal.Float64
	Free(signal.Float64)
}

Pool provides pooling of signal.Float64 buffers.

type ProcessFunc added in v0.6.0

type ProcessFunc func(signal.Float64) error

ProcessFunc is closure of pipe.Processor that processes messages.

type Processor

type Processor struct {
	ID    string
	Fn    ProcessFunc
	Meter metric.ResetFunc
	Hooks
}

Processor executes pipe.Processor components.

func (Processor) Run

func (r Processor) Run(pipeID, componentID string, cancel <-chan struct{}, in <-chan Message) (<-chan Message, <-chan error)

Run starts the Processor runner.

type Pump

type Pump struct {
	ID    string
	Fn    PumpFunc
	Meter metric.ResetFunc
	Hooks
}

Pump executes pipe.Pump components.

func (Pump) Run

func (r Pump) Run(p Pool, pipeID, componentID string, cancel <-chan struct{}, give chan<- string, take <-chan Message) (<-chan Message, <-chan error)

Run starts the Pump runner.

type PumpFunc

type PumpFunc func(signal.Float64) error

PumpFunc is closure of pipe.Pump that emits new messages.

type Sink

type Sink struct {
	ID    string
	Fn    SinkFunc
	Meter metric.ResetFunc
	Hooks
}

Sink executes pipe.Sink components.

func (Sink) Run

func (r Sink) Run(p Pool, pipeID, componentID string, cancel <-chan struct{}, in <-chan Message) <-chan error

Run starts the sink runner.

type SinkFunc

type SinkFunc func(signal.Float64) error

SinkFunc is closure of pipe.Sink that sinks messages.

Jump to

Keyboard shortcuts

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