wrapper

package
v0.5.12 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStreamWrapper

func NewStreamWrapper(stream stream.Streamer, whereObj condition.Condition, metrics metrics.Metricer) stream.Streamer

NewStreamWrapper with support condition

Types

type StreamWrapper

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

StreamWrapper extends any stream interface with conditional check support to any message

func (*StreamWrapper) Check

func (s *StreamWrapper) Check(ctx context.Context, msg message.Message) bool

Check if the message meets the conditions

func (*StreamWrapper) Close

func (s *StreamWrapper) Close() error

Close stream and shut down all process

func (*StreamWrapper) ID

func (s *StreamWrapper) ID() string

ID returns unical stream identificator

func (*StreamWrapper) Put

func (s *StreamWrapper) Put(ctx context.Context, msg message.Message) error

Put message to the stream to process information

func (*StreamWrapper) Run

func (s *StreamWrapper) Run(ctx context.Context) error

Run the stream reading loop

Jump to

Keyboard shortcuts

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