channel

package
v2.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Sink

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

Sink represents a channel sink.

func NewSink

func NewSink(ch chan *streams.Message, batch int) *Sink

NewSink creates a new channel Sink.

A batch size of 0 will never commit.

func (*Sink) Close

func (s *Sink) Close() error

Close closes the processor.

func (*Sink) Process

func (s *Sink) Process(msg *streams.Message) error

Process processes the stream Message.

func (*Sink) WithPipe

func (s *Sink) WithPipe(pipe streams.Pipe)

WithPipe sets the pipe on the Processor.

type Source

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

Source represents a source that consumes messages from a channel.

func NewSource

func NewSource(ch chan *streams.Message) *Source

NewSource creates a new channel Source.

func (*Source) Close

func (s *Source) Close() error

Close closes the Source.

func (*Source) Commit

func (s *Source) Commit(interface{}) error

Commit marks the consumed records as processed.

func (*Source) Consume

func (s *Source) Consume() (*streams.Message, error)

Consume gets the next record from the Source.

Jump to

Keyboard shortcuts

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