优化代码

This commit is contained in:
boyce
2025-09-21 18:41:03 +08:00
parent a54b3c59fc
commit 3bcce31a86
9 changed files with 247 additions and 128 deletions

View File

@@ -5,7 +5,20 @@ type Blueprint struct {
graphPool GraphPool
}
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string) {
bm.execPool.Load(execDefFilePath)
bm.graphPool.Load(graphFilePath)
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string, onRegister func(execPool *ExecPool) error) error {
err := bm.execPool.Load(execDefFilePath)
if err != nil {
return err
}
err = onRegister(&bm.execPool)
if err != nil {
return err
}
err = bm.graphPool.Load(&bm.execPool, graphFilePath)
if err != nil {
return err
}
return nil
}