Changed to SignalChannel

graph-rework
noah metz 2023-06-18 19:18:11 -06:00
parent d8318a0a85
commit 3e983cfece
1 changed files with 3 additions and 8 deletions

@ -158,8 +158,7 @@ type GraphNode interface {
RegisterChannel(listener chan GraphSignal) RegisterChannel(listener chan GraphSignal)
UnregisterChannel(listener chan GraphSignal) UnregisterChannel(listener chan GraphSignal)
UpdateChannel() chan GraphSignal UpdateChannel() chan GraphSignal
Update(signal GraphSignal) SignalChannel() chan GraphSignal
GetUpdate() GraphSignal
} }
func NewBaseNode(name string, description string, id string) BaseNode { func NewBaseNode(name string, description string, id string) BaseNode {
@ -185,12 +184,8 @@ type BaseNode struct {
listeners map[chan GraphSignal]chan GraphSignal listeners map[chan GraphSignal]chan GraphSignal
} }
func (node * BaseNode) Update(signal GraphSignal) { func (node * BaseNode) SignalChannel() chan GraphSignal {
node.signal <- signal return node.signal
}
func (node * BaseNode) GetUpdate() GraphSignal {
return <- node.signal
} }
func (node * BaseNode) Name() string { func (node * BaseNode) Name() string {