Skip to content

Commit

Permalink
update comments in event.go
Browse files Browse the repository at this point in the history
Signed-off-by: Chetan Banavikalmutt <[email protected]>
  • Loading branch information
chetan-rns committed Nov 25, 2024
1 parent 014bbf9 commit 0220027
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ func (ew *EventWriter) Remove(ev *cloudevents.Event) {
}
}

// SendWaitingEvents will periodically send the events waiting in the EventWriter.
// Note: This function will never return unless the context is done, and therefore
// should be started in a separate goroutine.
func (ew *EventWriter) SendWaitingEvents(ctx context.Context) {
ew.log.Info("Starting event writer")
for {
Expand Down Expand Up @@ -406,6 +409,7 @@ func (ew *EventWriter) sendEvent(resID string) {
return
}

// A Send() on the stream is actually not blocking.
err = ew.target.Send(&eventstreamapi.Event{Event: pev})
if err != nil {
logCtx.Errorf("Error while sending: %v\n", err)
Expand Down

0 comments on commit 0220027

Please sign in to comment.