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)
}
}
// ignore signals other than "abort" and "do_action"
return "wait", nil
}
@ -394,15 +393,7 @@ func NewEventQueue(name string, description string, required_resources []Resourc
}
}
queue.actions["event_done"] = func() (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) {
queue.handlers["resource_connected"] = func(signal GraphSignal) (string, error) {
return "queue_event", nil
}

@ -128,9 +128,7 @@ func fake_data() * EventManager {
func main() {
go func() {
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()

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