Skip to content

Commit

Permalink
Merge pull request #837 from hieblmi/fsm-notif-context
Browse files Browse the repository at this point in the history
fsm: add event context to notification struct
  • Loading branch information
hieblmi authored Oct 16, 2024
2 parents 0ab40fe + 93413ff commit 32ab262
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fsm/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ type Notification struct {
NextState StateType
// Event is the event that was processed.
Event EventType
// EventContext is the event context that was processed.
EventContext EventContext
// LastActionError is the error returned by the last action executed.
LastActionError error
}
Expand Down Expand Up @@ -222,6 +224,7 @@ func (s *StateMachine) SendEvent(event EventType, eventCtx EventContext) error {
PreviousState: s.previous,
NextState: s.current,
Event: event,
EventContext: eventCtx,
LastActionError: s.LastActionError,
}

Expand Down

0 comments on commit 32ab262

Please sign in to comment.