Documentation
¶
Index ¶
- Constants
- type ParallelCompilationService
- type ParallelExecutionOrchestratorImpl
- func (o *ParallelExecutionOrchestratorImpl) ConfigureConcurrency(maxWorkers int) error
- func (o *ParallelExecutionOrchestratorImpl) ConfigureTimeout(timeout time.Duration) error
- func (o *ParallelExecutionOrchestratorImpl) ExecuteParallel(ctx context.Context, tasks []parallel.CompilationTask) (*parallel.ParallelCompilationResult, error)
Constants ¶
const ( // DefaultMaxWorkers is the compilation concurrency used until // ConfigureConcurrency says otherwise. DefaultMaxWorkers = 4 // DefaultTaskTimeout bounds a single compilation that carries no timeout // of its own. DefaultTaskTimeout = 30 * time.Second )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ParallelCompilationService ¶
type ParallelCompilationService struct {
// contains filtered or unexported fields
}
ParallelCompilationService implements the ParallelCompiler interface
func NewParallelCompilationService ¶
func NewParallelCompilationService( orchestrator parallel.ParallelExecutionOrchestrator, resultCollector parallel.CompilationResultCollector, strategies []parallel.CompilationStrategy, ) *ParallelCompilationService
NewParallelCompilationService creates a new parallel compilation service
func (*ParallelCompilationService) CompileTemplates ¶
func (p *ParallelCompilationService) CompileTemplates( ctx context.Context, request parallel.ParallelCompilationRequest, ) (*parallel.ParallelCompilationResult, error)
CompileTemplates compiles multiple templates in parallel
type ParallelExecutionOrchestratorImpl ¶
type ParallelExecutionOrchestratorImpl struct {
// contains filtered or unexported fields
}
ParallelExecutionOrchestratorImpl implements the ParallelExecutionOrchestrator interface
func NewParallelExecutionOrchestrator ¶
func NewParallelExecutionOrchestrator(strategies ...parallel.CompilationStrategy) *ParallelExecutionOrchestratorImpl
NewParallelExecutionOrchestrator creates a new parallel execution orchestrator. Strategies are the abstractions compilation is dispatched through; an orchestrator built without any fails every task as unhandled.
func (*ParallelExecutionOrchestratorImpl) ConfigureConcurrency ¶
func (o *ParallelExecutionOrchestratorImpl) ConfigureConcurrency(maxWorkers int) error
ConfigureConcurrency sets the maximum number of concurrent workers
func (*ParallelExecutionOrchestratorImpl) ConfigureTimeout ¶
func (o *ParallelExecutionOrchestratorImpl) ConfigureTimeout(timeout time.Duration) error
ConfigureTimeout sets the timeout for individual tasks
func (*ParallelExecutionOrchestratorImpl) ExecuteParallel ¶
func (o *ParallelExecutionOrchestratorImpl) ExecuteParallel( ctx context.Context, tasks []parallel.CompilationTask, ) (*parallel.ParallelCompilationResult, error)
ExecuteParallel runs tasks through a bounded worker pool.
The pool bounds goroutine CREATION, not merely execution: exactly workerCount goroutines exist regardless of how many tasks are queued. Acquiring a semaphore inside a per-task goroutine would bound only progress, leaving one parked goroutine per task.