mirror of
https://github.com/duanhf2012/origin.git
synced 2026-03-06 22:27:36 +08:00
添加模块与定时器功能
This commit is contained in:
@@ -7,28 +7,31 @@ import (
|
||||
type Blueprint struct {
|
||||
execPool ExecPool
|
||||
graphPool GraphPool
|
||||
|
||||
blueprintModule IBlueprintModule
|
||||
}
|
||||
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string) error {
|
||||
func (bm *Blueprint) Init(execDefFilePath string, graphFilePath string, blueprintModule IBlueprintModule) error {
|
||||
err := bm.execPool.Load(execDefFilePath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
for _, e := range execNodes {
|
||||
if !bm.execPool.Register(e) {
|
||||
return fmt.Errorf("register exec failed,exec:%s", e.GetName())
|
||||
}
|
||||
}
|
||||
|
||||
err = bm.graphPool.Load(&bm.execPool, graphFilePath)
|
||||
err = bm.graphPool.Load(&bm.execPool, graphFilePath, blueprintModule)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
bm.blueprintModule = blueprintModule
|
||||
return nil
|
||||
}
|
||||
|
||||
func (bm *Blueprint) Create(graphName string) IGraph {
|
||||
return bm.graphPool.Create(graphName)
|
||||
func (bm *Blueprint) Create(graphName string, graphID int64) IGraph {
|
||||
return bm.graphPool.Create(graphName, graphID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user