parallel

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: GPL-3.0 Imports: 2 Imported by: 1

Documentation

Overview

Package parallel runs a batch of jobs a few at a time: the reads a sweep makes of a server that answers one request at a time no faster than eight.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Each

func Each(ctx context.Context, n, workers int, fn func(ctx context.Context, i int) error) error

Each runs fn for each of n jobs, at most workers at a time - one when workers is below one - and returns the first error. That error ends the run: a job not yet started is not started, and the ones running are told through their context, whose cause it is.

When no job failed and the caller's context ended the run, Each returns that context's cause, so a run cut short is never read as one that finished.

Types

This section is empty.

Jump to

Keyboard shortcuts

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