mirror of
https://github.com/duanhf2012/origin.git
synced 2026-04-14 21:17:29 +08:00
优化蓝图
This commit is contained in:
@@ -187,9 +187,12 @@ func (bm *Blueprint) Do(graphID int64, entranceID int64, args ...any) (Port_Arra
|
|||||||
return nil, fmt.Errorf("can not find graph:%d", graphID)
|
return nil, fmt.Errorf("can not find graph:%d", graphID)
|
||||||
}
|
}
|
||||||
|
|
||||||
return graph.Do(entranceID, args...)
|
clone := graph.Clone()
|
||||||
|
return clone.Do(entranceID, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func (bm *Blueprint) ReleaseGraph(graphID int64) {
|
func (bm *Blueprint) ReleaseGraph(graphID int64) {
|
||||||
if graphID == 0 {
|
if graphID == 0 {
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ type IGraph interface {
|
|||||||
Release()
|
Release()
|
||||||
GetGraphFileName() string
|
GetGraphFileName() string
|
||||||
HotReload(newBaseGraph *baseGraph)
|
HotReload(newBaseGraph *baseGraph)
|
||||||
|
Clone() IGraph
|
||||||
}
|
}
|
||||||
|
|
||||||
type IBlueprintModule interface {
|
type IBlueprintModule interface {
|
||||||
@@ -168,7 +169,7 @@ func (gr *Graph) Do(entranceID int64, args ...any) (Port_Array, error) {
|
|||||||
|
|
||||||
if gr.globalVariables == nil {
|
if gr.globalVariables == nil {
|
||||||
gr.globalVariables = map[string]IPort{}
|
gr.globalVariables = map[string]IPort{}
|
||||||
}else {
|
} else {
|
||||||
gr.globalVariables[ReturnVarial] = nil
|
gr.globalVariables[ReturnVarial] = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -226,6 +227,11 @@ func (gr *Graph) HotReload(newBaseGraph *baseGraph) {
|
|||||||
gr.baseGraph = newBaseGraph
|
gr.baseGraph = newBaseGraph
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gr *Graph) GetGraphFileName() string{
|
func (gr *Graph) GetGraphFileName() string {
|
||||||
return gr.graphFileName
|
return gr.graphFileName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gr *Graph) Clone() IGraph {
|
||||||
|
cloneGr := *gr
|
||||||
|
return &cloneGr
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user