From 9342169281e87fc82f61fe7619f012eb2916bc59 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Sat, 3 Jun 2023 10:59:42 -0600 Subject: [PATCH] Removed extra handlers from event.go and renamed arena_connected to resource_connected --- event.go | 11 +---------- main.go | 4 +--- vex.go | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/event.go b/event.go index 330a9da..26e8c6e 100644 --- a/event.go +++ b/event.go @@ -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 } diff --git a/main.go b/main.go index 350e4d1..7babb87 100644 --- a/main.go +++ b/main.go @@ -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() diff --git a/vex.go b/vex.go index 3aa313f..d24a3c2 100644 --- a/vex.go +++ b/vex.go @@ -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)