A Go library for implementing HTTP long-polling servers and clients to enable web pub-sub communication.
golongpoll is a Go library that simplifies implementing HTTP long-polling for web pub-sub communication. It provides both server-side and client-side components to enable real-time event delivery between web clients and servers without requiring WebSockets or complex infrastructure.
Go developers building web applications that need real-time updates, such as chat systems, live notifications, or dashboard monitoring, where WebSockets are not feasible or desired.
Developers choose golongpoll for its simplicity and minimalism, offering a straightforward, configurable long-polling implementation with in-memory buffering, category-based events, and optional persistence, reducing internal complexity while remaining flexible for various web application needs.
golang long polling library. Makes web pub-sub easy via HTTP long-poll servers and clients :smiley: :coffee: :computer:
The QuickStart example shows creating a server with just a few lines of code using default options, making it easy to integrate long-polling into Go applications without complex configuration.
Options like MaxEventBufferSize and EventTimeToLiveSeconds allow precise control over event storage and expiration, as documented in the go docs, enabling tailored behavior for different use cases.
Works seamlessly with standard Go HTTP servers and can be wrapped for use with Gin, as demonstrated in the 'long polling and gin' section, providing flexibility for various web frameworks.
Includes both Go and JavaScript clients, simplifying web integration without needing to implement the HTTP API from scratch, as highlighted in the examples directory.
The README explicitly states that subscription handlers support only one category per call, requiring multiple requests for multi-category needs, a design decision that reduces flexibility for complex event systems.
Events are stored in-memory by default, leading to data loss on server restarts unless the optional FilePersistorAddOn is used, which adds extra setup and complexity not included in the core library.
HTTP long-polling inherently has higher latency and resource usage compared to WebSockets or Server-Sent Events, making it less efficient for high-frequency update scenarios, as noted in the library's focus on simplicity over speed.
Simple, reliable, and efficient distributed task queue in Go
Sarama is a Go library for Apache Kafka.
Scalable real-time messaging server in a language-agnostic way. Self-hosted alternative to Pubnub, Pusher, Ably, socket.io, Phoenix.PubSub, SignalR. Set up once and forever.
Building event-driven applications the easy way in Go.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.