group

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package group runs steps in parallel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Value any
	Error error
}

Result is what one parallel function returned.

type Results

type Results []Result

Results holds one Result per function, in order.

func Parallel

func Parallel(ctx context.Context, fns ...func(ctx context.Context) (any, error)) Results

Parallel runs fns as parallel steps. Each fn runs until its first new step. When new steps are found, the engine gets them all at once: step.Run calls are planned and then run one per request, at the same time; other steps (sleep, wait, invoke, send) start at once. Parallel returns only when every fn has finished; until then it stops the function like any other new step.

The fns run one after another in this goroutine, so step IDs are counted the same way on every call. Give each step in the group its own ID.

func (Results) AnyError

func (rs Results) AnyError() error

AnyError joins the errors of all results (nil if none failed).

Jump to

Keyboard shortcuts

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