prim

package
v0.0.0-...-a5b82e5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 0 Imported by: 0

README

Prim: Parallel primatives for production applications

The packages in prim is your one stop shop for advanced parallel primatives to create robust and easy to diagnose applications. These are parallel and not concurrent by definitions layed out in the famous Go talk by Rob Pike: https://go.dev/blog/waza-talk . We provide parallel and concurrent pipelines in our https://github.com/gostdlib/concurrency/pipelines set of packages.

go get github.com/gostdlib/concurrency/

A quick look

  • Use prim/wait if you want:
    • A safer version of sync.WaitGroup for parallel jobs
    • A parallel job runner that collects errors after all jobs complete
    • A parallel job runner that CAN stops processing on the first error
    • A parallel job runner that CAN be Context cancelled
    • Reuse and limiting of goroutines by supplying a goroutines.Pool
    • Integration with logging of your choice, including support for OpenTelemetry spans
  • Use prim/slices if you want:
    • To access elements in a slice in parallel to perform some operation
    • Support for processing errors
    • Support for OpenTelemetry spans
  • Use prim/chans if you want:
    • To access elements from a receive channel in parallel to perform some operation
    • Support for processing erors
    • Support for OpenTelemetry spans

Documentation

Overview

Package prim provides concurrency primatives that can be used to run concurrent operations in a safer manner than the stdlib with additional instrumentation and reuse options to prevent costly setup and teardown of goroutines (they are cheap, but they are not free).

Directories

Path Synopsis
Package chans provides functions for operating on recv channels in parallel.
Package chans provides functions for operating on recv channels in parallel.
Package slices provides functions for operating on slices in parallel.
Package slices provides functions for operating on slices in parallel.
Package wait provides a safer alternative to sync.WaitGroup.
Package wait provides a safer alternative to sync.WaitGroup.

Jump to

Keyboard shortcuts

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