Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
func Exec[T any](source TaskSource[T], opts Options[T])
Exec executes tasks from the source with limited parallelism.
Types ¶
type ChanSource ¶
type ChanSource[T any] struct { // contains filtered or unexported fields }
ChanSource wraps a channel as a TaskSource.
func FromChan ¶
func FromChan[T any](ch <-chan T) *ChanSource[T]
FromChan creates a TaskSource from a channel.
type FuncSource ¶
type FuncSource[T any] struct { // contains filtered or unexported fields }
FuncSource generates tasks from a function.
type IterSource ¶
type IterSource[T any] struct { // contains filtered or unexported fields }
IterSource wraps an iter.Seq as a TaskSource.
func FromIter ¶
func FromIter[T any](seq iter.Seq[T]) *IterSource[T]
FromIter creates a TaskSource from an iterator.
func (*IterSource[T]) Next ¶
func (s *IterSource[T]) Next(ctx context.Context) (T, bool)
Next returns the next task from the iterator.
func (*IterSource[T]) Stop ¶
func (s *IterSource[T]) Stop()
Stop releases resources associated with the iterator.
type Pool ¶
type Pool[T any] struct { // contains filtered or unexported fields }
Pool is a worker pool that accepts tasks at runtime
type SliceSource ¶
type SliceSource[T any] struct { // contains filtered or unexported fields }
SliceSource iterates over a slice as a TaskSource.
func FromSlice ¶
func FromSlice[T any](items []T) *SliceSource[T]
FromSlice creates a TaskSource from a slice.
func FromSliceClone ¶
func FromSliceClone[T any](items []T) *SliceSource[T]
FromSliceClone creates a TaskSource from a slice, cloning the slice.
Click to show internal directories.
Click to hide internal directories.