Tags: lndbrg/event
Tags
Add backpressure handling to keep the memory in check when over-publi… …shing (kelindar#7) * Add memory and CPU profiling support, enhance Dispatcher with maxQueue * Improve backpressure handling in Broadcast method to wait for consumer processing when queues are at capacity * Reduce default max queue size in Dispatcher from 100k to 50k for improved performance * Add backpressure test to validate event processing under load
Fix ticker leak and improve readme (kelindar#6) * Add MIT License and enhance README with usage details; refactor event dispatcher for improved subscription handling * Refactor consumer's Listen method to optimize queue handling and improve readability * Add defer statement to stop ticker in group.Process method * Update default_test.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Enhance Dispatcher with atomic registry and add concurrent subscripti… …on (kelindar#5) * Enhance Dispatcher with atomic registry and add concurrent subscription tests - Implement atomic pointer for subscriber registry to improve performance and safety. - Introduce lock-free binary search for event type lookup. - Add tests to verify race conditions during concurrent subscriptions and handler registrations. * Update Go version in CI workflow to 1.20 * Refactor TestConcurrentSubscriptionRace for improved concurrency handling and verification
Use sync.Cond instead of channel for broadcast (kelindar#4) This PR removes the usage of channel for broadcast and instead makes use of `sync.Cond` primitive directly. Subscribers are also flushed periodically to avoid lock contention. This results in ~2-4x performance improvement depending on the conditions.
Make API more usable for generic types (kelindar#2) * Make API more usable for generic types * 1.19