Skip to content

Conversation

@AlanRostem
Copy link
Collaborator

Fixes #154

This PR improves the documentation of the event queue implementation, fixes an invalid check, and adds a warning log when the event queue is full.

All tests pass and things run as intended. Though it would be nice open an issue for stress testing the event queue further.

@AlanRostem AlanRostem requested a review from meling January 14, 2025 14:25
@AlanRostem AlanRostem linked an issue Jan 14, 2025 that may be closed by this pull request
// run handlers with runInAddEvent option
el.processEvent(event, true)
el.eventQ.push(event)
dropped := el.eventQ.push(event)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See details below...

droppedEvent := el.eventQ.push(event)
if droppedEvent != nil {
	el.logger.Warnf("event queue is full, dropped event: %v", droppedEvent)
}

Since queue.push() can drop events, we instead return the dropped
event so that we can log it...
@AlanRostem AlanRostem merged commit deb43ac into master Jan 16, 2025
4 checks passed
@AlanRostem AlanRostem deleted the 154-eventqueue-cleanup branch January 16, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chore: eventloop/queue implementation has some weirdness

3 participants