pseq

package
v0.0.0-...-5bd6445 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package pseq contains utilities for parallelisation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Each

func Each[A any](seq iter.Seq[A], f func(A))

Each runs f in parallel, passing in all elements from seq.

func Each2

func Each2[A, B any](seq iter.Seq2[A, B], f func(A, B))

Each2 runs f in parallel, passing in all pairs from seq.

func MapMerge

func MapMerge[A, B any](seq iter.Seq[A], f func(A) B, m func(B, B) B) B

MapMerge runs f in parallel, merging the results using m. m must be associative and commutative.

func MapReduce

func MapReduce[A, B, C any, K comparable](seq iter.Seq[A], m func(A) iter.Seq2[K, B], r func(K, iter.Seq[B]) C) iter.Seq2[K, C]

MapReduce runs a MapReduce pipeline. It runs m (the map phase) in parallel to split the sequence of inputs into key/value pairs. It then spawns one goroutine running r per key (the reduce phase). Lastly, the outputs of all reducers are output as a sequence.

Types

This section is empty.

Jump to

Keyboard shortcuts

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