package
0.0.0-20240403195145-a5b82e576be2
Repository: https://github.com/gostdlib/concurrency.git
Documentation: pkg.go.dev

# README

Slices: Parallel operations on slices

Go Reference

The slices package provides concurrent operations on slice types. This is for large slices that have complex transformations. For smaller use cases, a non-concurrent for loop will probably suffice.

go get github.com/gostdlib/concurrency/

A quick look

  • Access elements in a slice in parallel to perform some operation
  • Support for processing errors
  • Support for OpenTelemetry spans

Package purpose

  • Reduce programatic errors (goroutine leaks, deadlocks, ...)
  • Reuse resources (goroutines)
  • Integration with OpenTelemetry spans by default

# Functions

Access calls the Accessor for each element in "s".
WithPool sets a goroutines.Pool and its submit options used in a function call.
WithStopOnErr causes the operation to stop if an error occurs.

# Interfaces

SliceOption is an option for functions operating on slices.

# Type aliases

Accessor is a function that is called on each element in a slice.
Modifier sets a value in a slice to v.