From 4f7d172731e069c59ae9628f2e8820e99e2861e7 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Sun, 18 Jun 2023 19:11:10 -0600 Subject: [PATCH] Added Update method to GraphNode --- graph.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/graph.go b/graph.go index aa8069e..4391c67 100644 --- a/graph.go +++ b/graph.go @@ -158,6 +158,7 @@ type GraphNode interface { RegisterChannel(listener chan GraphSignal) UnregisterChannel(listener chan GraphSignal) UpdateChannel() chan GraphSignal + Update(signal GraphSignal) } func NewBaseNode(name string, description string, id string) BaseNode { @@ -183,6 +184,10 @@ type BaseNode struct { listeners map[chan GraphSignal]chan GraphSignal } +func (node * BaseNode) Update(signal GraphSignal) { + node.signal <- signal +} + func (node * BaseNode) Name() string { return node.name }