Source File
executor.go
Belonging Package
go.pact.im/x/task
package task
import (
)
var (
sequentialExecutor = executor{Sequential}
parallelExecutor = executor{Parallel}
)
// Executor abstracts the execution order for task groups.
type Executor interface {
Execute(ctx context.Context, cond CancelCondition, tasks ...Task) error
}
// executor implements the Executor interface using the underlying task group
// builder.
type executor struct {
group func(cond CancelCondition, tasks ...Task) Task
}
// SequentialExecutor returns an Executor instance for sequential execution.
func () Executor {
return &sequentialExecutor
}
// ParallelExecutor returns an Executor instance for parallel execution.
func () Executor {
return ¶llelExecutor
}
// Execute implements the Executor interface.
func ( *executor) ( context.Context, CancelCondition, ...Task) error {
return .group(, ...).Run()
}
The pages are generated with Golds v0.4.9. (GOOS=linux GOARCH=amd64)