From 5dce8ffab4f6af29d6f8019f3dc2d66472452b4d Mon Sep 17 00:00:00 2001 From: mrh997 Date: Thu, 6 Mar 2025 11:35:34 +0800 Subject: [PATCH] feat: optimized devops debugging example (#37) --- devops/debug/graph/graph.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/devops/debug/graph/graph.go b/devops/debug/graph/graph.go index fbaf2eb..c9a91fc 100644 --- a/devops/debug/graph/graph.go +++ b/devops/debug/graph/graph.go @@ -31,10 +31,17 @@ func RegisterSimpleGraph(ctx context.Context) { return input + " process by node_1,", nil })) - _ = g.AddLambdaNode("node_2", compose.InvokableLambda(func(ctx context.Context, input string) (output string, err error) { - return input + " process by node_2,", nil + sg := compose.NewGraph[string, string]() + _ = sg.AddLambdaNode("sg_node_1", compose.InvokableLambda(func(ctx context.Context, input string) (output string, err error) { + return input + " process by sg_node_1,", nil })) + _ = sg.AddEdge(compose.START, "sg_node_1") + + _ = sg.AddEdge("sg_node_1", compose.END) + + _ = g.AddGraphNode("node_2", sg) + _ = g.AddLambdaNode("node_3", compose.InvokableLambda(func(ctx context.Context, input string) (output string, err error) { return input + " process by node_3,", nil }))