stream

package
v1.3.3-0...-f31c912 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ZipStreams

type ZipStreams[T, V any] struct {
	// contains filtered or unexported fields
}

ZipStreams is a helper for iterate two streams and process elements in the leader stream only if they don't already exists in the follower stream. The streams must be sorted and comparable.

func NewZipStreams

func NewZipStreams[T, V any](leader stream.Stream[T], follower stream.Stream[V],
	onMissing func(elem T) error,
	onEqualKeys func(leader T, follower V) error,
	compare func(leader T, follower V) int,
) *ZipStreams[T, V]

NewZipStreams returns a new instance of ZipStreams.

func (*ZipStreams[T, V]) Process

func (z *ZipStreams[T, V]) Process() error

Process consumes the streams and returns an error reported by handler functions. Processing will stop on the first error.

Jump to

Keyboard shortcuts

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