Added GetUpdate method to GraphNode

graph-rework
noah metz 2023-06-18 19:16:11 -06:00
parent 30b539ad74
commit d8318a0a85
1 changed files with 5 additions and 0 deletions

@ -159,6 +159,7 @@ type GraphNode interface {
UnregisterChannel(listener chan GraphSignal) UnregisterChannel(listener chan GraphSignal)
UpdateChannel() chan GraphSignal UpdateChannel() chan GraphSignal
Update(signal GraphSignal) Update(signal GraphSignal)
GetUpdate() GraphSignal
} }
func NewBaseNode(name string, description string, id string) BaseNode { func NewBaseNode(name string, description string, id string) BaseNode {
@ -188,6 +189,10 @@ func (node * BaseNode) Update(signal GraphSignal) {
node.signal <- signal node.signal <- signal
} }
func (node * BaseNode) GetUpdate() GraphSignal {
return <- node.signal
}
func (node * BaseNode) Name() string { func (node * BaseNode) Name() string {
return node.name return node.name
} }