MCPcopy Create free account
hub / github.com/DoNewsCode/core / Run

Method Run

dag/dag.go:99–110  ·  view source on GitHub ↗

Run runs the dag. Vertexes with no dependency will be scheduled concurrently while the inked vertexes will be scheduled sequentially. The Scheduler optimizes the execution path so that the overall dag execution time is minimized. If a vertex returns an error or if the dag context is canceled, the s

(ctx context.Context)

Source from the content-addressed store, hash-verified

97// dag caller) is to store the results in context with the help of package
98// ctxmeta. See example.
99func (d *DAG) Run(ctx context.Context) error {
100 errGroup, ctx := errgroup.WithContext(ctx)
101 for _, v := range d.vertexes {
102 v := v
103 if len(v.parents) == 0 {
104 errGroup.Go(func() error {
105 return v.execute(ctx)
106 })
107 }
108 }
109 return errGroup.Wait()
110}
111
112func (d *DAG) fmtEdges(edges []int) interface{} {
113 var s []string

Callers 15

TestServeIn_signalWatchFunction · 0.45
cronServeMethod · 0.45
cronServeDeprecatedMethod · 0.45
newServeCmdFunction · 0.45
TestC_AddModuleFunction · 0.45
TestEncoderFunction · 0.45
TestDebugModuleFunction · 0.45
TestNewRedisFactoryFunction · 0.45

Calls 1

executeMethod · 0.80

Tested by 15

TestServeIn_signalWatchFunction · 0.36
TestC_AddModuleFunction · 0.36
TestEncoderFunction · 0.36
TestDebugModuleFunction · 0.36
TestNewRedisFactoryFunction · 0.36
TestProvideFactoryFunction · 0.36
TestProvideDBFactoryFunction · 0.36