parallel

package
v1.0.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, name string, fn JobFunc) error

Types

type Job

type Job struct {
	Name string
	Func JobFunc

	Internal         bool
	Reveal           bool
	ContextualTracer bool
	RollupLogs       bool
	RollupSpans      bool
	// If set to false, tracing is completely disabled (no otel spans are created)
	Tracing bool
	// contains filtered or unexported fields
}

func (Job) Run

func (job Job) Run(ctx context.Context) error

func (Job) Runner

func (job Job) Runner(ctx context.Context) func() error

type JobFunc

type JobFunc func(context.Context) error

type Jobs

type Jobs struct {
	Jobs     []Job
	Limit    *int
	Internal bool
	Reveal   bool
	// Use the "contextual tracer".
	// If enabled, spans are created using the same tracer that created the current span.
	// If disabled, spans are created using the global tracer for this process
	// Typically, you need to enable this in multi-tenant systems with many client contexts,
	// each with their own tracer (eg. inside the dagger engine)
	//
	ContextualTracer bool

	// Roll up child logs into this span.
	RollupLogs bool
	// Roll up child spans into this span for aggregated progress display.
	RollupSpans bool
	Tracing     bool // If set to false, tracing is completely disabled (no otel spans are created)

	// If true, cancel remaining jobs when the first job returns an error.
	FailFast bool
}

Jobs is a set of jobs to run together, built up with the With methods and executed by Run.

func New

func New() Jobs

func (Jobs) Clone

func (p Jobs) Clone() Jobs

func (Jobs) Run

func (p Jobs) Run(ctx context.Context) error

func (Jobs) RunSerial

func (p Jobs) RunSerial(ctx context.Context) error

func (Jobs) WithContextualTracer

func (p Jobs) WithContextualTracer(contextualTracer bool) Jobs

func (Jobs) WithFailFast

func (p Jobs) WithFailFast(failFast bool) Jobs

func (Jobs) WithInternal

func (p Jobs) WithInternal(internal bool) Jobs

func (Jobs) WithJob

func (p Jobs) WithJob(name string, fn JobFunc, attributes ...attribute.KeyValue) Jobs

func (Jobs) WithLimit

func (p Jobs) WithLimit(limit int) Jobs

func (Jobs) WithReveal

func (p Jobs) WithReveal(reveal bool) Jobs

func (Jobs) WithRollupLogs

func (p Jobs) WithRollupLogs(rollupLogs bool) Jobs

func (Jobs) WithRollupSpans

func (p Jobs) WithRollupSpans(rollupSpans bool) Jobs

func (Jobs) WithTracing

func (p Jobs) WithTracing(tracing bool) Jobs

Jump to

Keyboard shortcuts

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