Removed extra handlers from event.go and renamed arena_connected to resource_connected

graph-rework
noah metz 2023-06-03 10:59:42 -06:00
parent 301dbb6b94
commit 9342169281
3 changed files with 3 additions and 14 deletions

@ -274,7 +274,6 @@ func NewBaseEvent(name string, description string, required_resources []Resource
return signal_fn(signal) return signal_fn(signal)
} }
} }
// ignore signals other than "abort" and "do_action"
return "wait", nil return "wait", nil
} }
@ -394,15 +393,7 @@ func NewEventQueue(name string, description string, required_resources []Resourc
} }
} }
queue.actions["event_done"] = func() (string, error) { queue.handlers["resource_connected"] = func(signal GraphSignal) (string, error) {
return "queue_event", nil
}
queue.actions["resource_update"] = func() (string, error) {
return "queue_event", nil
}
queue.handlers["arena_connected"] = func(signal GraphSignal) (string, error) {
return "queue_event", nil return "queue_event", nil
} }

@ -128,9 +128,7 @@ func fake_data() * EventManager {
func main() { func main() {
go func() { go func() {
time.Sleep(5 * time.Second) time.Sleep(5 * time.Second)
if false {
pprof.Lookup("goroutine").WriteTo(os.Stdout, 1) pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
}
}() }()
event_manager := fake_data() event_manager := fake_data()

@ -99,7 +99,7 @@ func (arena * Arena) Connect(abort chan error) bool {
go func(arena * Arena, abort chan error) { go func(arena * Arena, abort chan error) {
owner := arena.Owner() owner := arena.Owner()
update_str := fmt.Sprintf("VIRTUAL_ARENA connected: %s", arena.Name()) update_str := fmt.Sprintf("VIRTUAL_ARENA connected: %s", arena.Name())
signal := NewSignal(arena, "arena_connected") signal := NewSignal(arena, "resource_connected")
signal.description = update_str signal.description = update_str
arena.connected = true arena.connected = true
go SendUpdate(arena, signal) go SendUpdate(arena, signal)