pubsub

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Iterator

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

Iterator is a iterator for Pub/Sub communication model. It receives any new message from NATS.

func NewIterator

func NewIterator(ctx context.Context, params IteratorParams) (*Iterator, error)

NewIterator creates new instance of the Iterator.

func (*Iterator) HasNext

func (i *Iterator) HasNext(ctx context.Context) bool

HasNext checks is the iterator has messages.

func (*Iterator) Next

func (i *Iterator) Next(ctx context.Context) (sdk.Record, error)

Next returns the next record from the underlying messages channel.

func (*Iterator) Stop

func (i *Iterator) Stop() (err error)

Stop stops the Iterator, unsubscribes from a subject.

type IteratorParams

type IteratorParams struct {
	Conn       *nats.Conn
	BufferSize int
	Subject    string
}

IteratorParams contains incoming params for the NewIterator function.

Jump to

Keyboard shortcuts

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