diff --git a/internal/simulation/engine.go b/internal/simulation/engine.go index edee4a7..574e5a5 100644 --- a/internal/simulation/engine.go +++ b/internal/simulation/engine.go @@ -23,6 +23,7 @@ type SimulationNode interface { Emit() []*Request IsAlive() bool GetTargets() []string + GetQueue() []*Request } type Engine struct { @@ -57,6 +58,16 @@ func NewEngineFromDesign(design design.Design, duration int, tickMs int) *Engine Alive: true, Queue: []*Request{}, } + case "loadBalancer": + props := n.Props + simNode = &LoadBalancerNode{ + ID: n.ID, + Label: asString(props["label"]), + Algorithm: asString(props["algorithm"]), + Queue: []*Request{}, + Alive: true, + Targets: []string{}, + } case "cache": simNode = &CacheNode{ ID: n.ID,