Comments (1)
SSE opens a long term connection, that's how the protocol works, you may want to learn more about it here.
You send data to the client when you have new data, so you should call SendMessage only when you have new data. This is validation on your side, not the library.
By protocol standard, once a client connects it's ready to receive data, there's no need to receive some POST from clients to start receiving data, and also, the protocol and the library supports replay of old messages in case of disconnection (using the Last Event ID).
from go-sse.
Related Issues (16)
- Conditional logging HOT 3
- Javascript client is receiving messages by batch HOT 1
- obsolete CloseNotifier() HOT 1
- Using with Echo? HOT 3
- "welcome" event HOT 11
- Add HTTP/2 support HOT 1
- Data races HOT 10
- Multiple open tabs communicating HOT 3
- Last Event ID HOT 3
- panic on graceful shutdown HOT 4
- gofmt your code HOT 2
- Does not work with gzip.DefaultCompression
- Message retry always 0?
- Not safe for concurrent use HOT 3
- *middleware.compressResponseWriter is not http.CloseNotifier: HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-sse.