Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregateResult ¶
AggregateResult contains one result per graph node in stable topological order.
func (*AggregateResult) ResultFor ¶
func (r *AggregateResult) ResultFor(nodeID string) (Result, bool)
ResultFor returns the result for a node ID.
func (*AggregateResult) Success ¶
func (r *AggregateResult) Success() bool
Success reports whether all scheduled nodes completed successfully.
type Dispatcher ¶
Dispatcher executes one scheduler node. Tool-specific execution belongs behind this interface so the scheduler remains component-type agnostic.
type DispatcherFunc ¶
DispatcherFunc adapts a function into a Dispatcher.
func (DispatcherFunc) Dispatch ¶
func (f DispatcherFunc) Dispatch(ctx context.Context, node *dependency.Node) (Result, error)
Dispatch calls f(ctx, node).
type Option ¶
type Option func(*Scheduler)
Option configures a Scheduler.
func WithFailFast ¶
WithFailFast controls whether the scheduler stops scheduling after a node error.
func WithMaxConcurrency ¶
WithMaxConcurrency sets the number of workers allowed to run at once.
func WithNodeCompleteHook ¶
func WithNodeCompleteHook(hook func(*dependency.Node, Result)) Option
WithNodeCompleteHook registers a callback after a node dispatch finishes.
func WithNodeStartHook ¶
func WithNodeStartHook(hook func(*dependency.Node)) Option
WithNodeStartHook registers a callback before a node is dispatched.
type Scheduler ¶
type Scheduler struct {
// contains filtered or unexported fields
}
Scheduler manages ready-queue DAG execution with a bounded worker pool.
func New ¶
func New(graph *dependency.Graph, dispatcher Dispatcher, opts ...Option) *Scheduler
New creates a scheduler for graph and dispatcher.