seq

package
v0.0.0-...-2d731ca Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromChan

func FromChan[T any](ctx context.Context, in <-chan T) iter.Seq[T]

FromChan - chan to iter.Seq

func FromChans

func FromChans[T any](ctx context.Context, ins []<-chan T) []iter.Seq[T]

FromChans - slice of channels to slice of iter.Seq

func Shards

func Shards[IN, OUT any](
	ctx context.Context,
	ins []iter.Seq[IN],
	handler gather.HandlerFunc[IN, OUT],
	buffer int,
	workerOpts ...gather.Opt,
) []iter.Seq[OUT]

Shards - integrates shard.Apply using iter.Seq in place of channels by default, shards will use the same buffer as the input

func ToChan

func ToChan[T any](ctx context.Context, in iter.Seq[T], buffer int) <-chan T

ToChan - iter.Seq to chan

func ToChans

func ToChans[T any](ctx context.Context, ins []iter.Seq[T], buffer int) []<-chan T

ToChans - slice of iter.Seqs to slice of channels

func Workers

func Workers[IN, OUT any](
	ctx context.Context,
	in iter.Seq[IN],
	handler gather.HandlerFunc[IN, OUT],
	buffer int,
	workerOpts ...gather.Opt,
) iter.Seq[OUT]

Workers - integrates with gather.Workers using iter.Seq in place of channels by default, the workers will use the same buffer as the input

Types

This section is empty.

Jump to

Keyboard shortcuts

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