MCPcopy Create free account
hub / github.com/commander-cli/commander / NewRuntime

Function NewRuntime

pkg/runtime/runtime.go:20–36  ·  view source on GitHub ↗

NewRuntime creates a new runtime and inits default nodes

(eh *EventHandler, nodes ...Node)

Source from the content-addressed store, hash-verified

18
19// NewRuntime creates a new runtime and inits default nodes
20func NewRuntime(eh *EventHandler, nodes ...Node) Runtime {
21 local := Node{
22 Name: "local",
23 Type: "local",
24 Addr: "localhost",
25 }
26
27 nodes = append(nodes, local)
28 runner := Runner{
29 Nodes: nodes,
30 }
31
32 return Runtime{
33 Runner: &runner,
34 EventHandler: eh,
35 }
36}
37
38// Runtime represents the current runtime, please use NewRuntime() instead of creating an instance directly
39type Runtime struct {

Callers 3

executeFunction · 0.92
Test_AlphabeticalOrderFunction · 0.85
getRuntimeFunction · 0.85

Calls

no outgoing calls

Tested by 2

Test_AlphabeticalOrderFunction · 0.68
getRuntimeFunction · 0.68