parallel

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package parallel provides a generic worker pool for concurrent processing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run[T any, R any](items []T, workers int, fn func(T) R, onResult func(completed, total int, result R)) []R

Run executes fn for each item using the given number of workers. The onResult callback is called sequentially from a single goroutine as results complete, making it safe to write to stdout without additional synchronization. Results are returned in completion order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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