From 946b93c5f9985a2296b0e0b5f87c0f2371127899 Mon Sep 17 00:00:00 2001 From: Chris Doherty Date: Tue, 24 Oct 2023 10:54:45 -0500 Subject: [PATCH] Update Event interface code doc Signed-off-by: Chris Doherty --- internal/agent/event/event.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/agent/event/event.go b/internal/agent/event/event.go index 3331beb34..b2fe0eec8 100644 --- a/internal/agent/event/event.go +++ b/internal/agent/event/event.go @@ -7,7 +7,18 @@ import "context" // Name is a unique name identifying an event. type Name string -// Event is a recordable event. +// Event is an event generated during execution of a Workflow. Each event in the event package +// implements this interface. Consumers may type switch the Event to the appropriate type for +// event handling. +// +// E.g. +// +// switch ev.(type) { +// case event.ActionStarted: +// // Handle ActionStarted event. +// default: +// // Unsupported event. +// } type Event interface { // GetName retrieves the event name. GetName() Name