Documentation
¶
Index ¶
- func ExecuteBulkOperation[R Reporter](ctx context.Context, keys []string, wantedWorkers int, failFast bool, ...) ([]R, error)
- func ExecuteNTimes[T any](ctx context.Context, n int, wantedWorkers int, failFast bool, ...) ([]T, error)
- func ExecuteSlice[In any, Out any](ctx context.Context, in []In, wantedWorkers int, failFast bool, ...) ([]Out, error)
- type Reporter
- type Reports
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteBulkOperation ¶
func ExecuteBulkOperation[R Reporter](ctx context.Context, keys []string, wantedWorkers int, failFast bool, operationName string, log *slog.Logger, opts []foptions.FacadeOption, fn func(context.Context, string, ...foptions.FacadeOption) (R, error)) ([]R, error)
ExecuteBulkOperation executes a bulk operation on a slice of keys with parallel workers Returns a slice of reports and an optional error
func ExecuteNTimes ¶
func ExecuteNTimes[T any](ctx context.Context, n int, wantedWorkers int, failFast bool, fn func(context.Context, int) (T, error)) ([]T, error)
ExecuteNTimes runs fn for indices [0,n) with at most wantedWorkers concurrent goroutines, cancelling all work on context cancellation or the first error when failFast is true. It normalizes worker counts (clamping to [1,n]), allocates result/error slots up front, and returns a slice of outputs along with a joined error capturing every failure.
Types ¶
Click to show internal directories.
Click to hide internal directories.