From 707501d131b3aa337529fca1c73922e5c2e35e6d Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 19 Jun 2023 00:33:42 -0600 Subject: [PATCH] Added ClearTimeout to Event interface --- event.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/event.go b/event.go index 8d0a9b2..f0e211b 100644 --- a/event.go +++ b/event.go @@ -73,6 +73,7 @@ type Event interface { RequiredResources() []Resource DoneResource() Resource SetTimeout(end_time time.Time, action string) + ClearTimeout() Timeout() <-chan time.Time TimeoutAction() string Signal() chan GraphSignal @@ -95,6 +96,11 @@ func (event * BaseEvent) Timeout() <-chan time.Time { return event.timeout } +func (event * BaseEvent) ClearTimeout() { + event.timeout_action = "" + event.timeout = nil +} + func (event * BaseEvent) SetTimeout(end_time time.Time, action string) { event.timeout_action = action event.timeout = time.After(time.Until(end_time))