stream

package
v0.0.0-...-bb3eb04 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2021 License: MIT Imports: 4 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 is an implementation of a message sync; it receives messages broadcast by its parent source.

func (*Sink) Close

func (s *Sink) Close()

Close releases any resources allocated as part of this sink's creation.

func (*Sink) Messages

func (s *Sink) Messages() <-chan proto.Message

Messages returns the read channel of messages broadcast by the source. The backing channel is buffered to allow for additional messages to be generated while the current message is being processed; that being said the sink has a responsibility to consume messages from this channel as quickly as possible.

type Source

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

Source represents a message source that will be broadcast to its sinks.

func NewSource

func NewSource(logger *zap.Logger) *Source

NewSource creates a new message source.

func (*Source) NewSink

func (s *Source) NewSink() *Sink

NewSink creates a message sink for this source.

func (*Source) SendMessage

func (s *Source) SendMessage(msg proto.Message)

SendMessage sends a message to all created sinks.

Jump to

Keyboard shortcuts

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