luigiutils

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBendyStreamSink added in v0.2.1

func NewBendyStreamSink(w *muxrpc.ByteSink) luigi.Sink

func NewGabbyStreamSink

func NewGabbyStreamSink(w *muxrpc.ByteSink) luigi.Sink

NewGabbyStreamSink expects the values passing through to be of type multimsg.MultiMessage it then unpacks them as gabygrove, reencodes the transfer object to bytes and passes those as muxrpc codec.Body to the wrapped sink

func NewSinkCounter

func NewSinkCounter(counter *int, sink luigi.Sink) luigi.FuncSink

NewSinkCounter returns a new Sink which increases the given counter when poured to. warning: also counts errored pour calls on the wrapped sink

Types

type MultiSink

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

MultiSink takes each message poured into it, and passes it on to all registered sinks.

MultiSink is like luigi.Broadcaster but with context support.

func NewMultiSink

func NewMultiSink(seq int64) *MultiSink

func (*MultiSink) Close

func (f *MultiSink) Close() error

func (*MultiSink) Count

func (f *MultiSink) Count() uint

Count returns the number of registerd sinks

func (*MultiSink) Register

func (f *MultiSink) Register(
	ctx context.Context,
	sink *muxrpc.ByteSink,
	until int64,
)

Register adds a sink to propagate messages to upto the 'until'th sequence.

func (*MultiSink) Send

func (f *MultiSink) Send(msg []byte)

func (*MultiSink) Seq

func (f *MultiSink) Seq() int64

func (*MultiSink) Unregister

func (f *MultiSink) Unregister(
	sink *muxrpc.ByteSink,
)

Jump to

Keyboard shortcuts

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