seq

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package seq - used to wrap iter.Seq around gather this can be used to allow abstraction of channels

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