This tag is for questions relating to event streams in HTTP. Event streams are an easy way for a server to have a continuous connection with the client and send data back and forth.
Questions tagged [event-stream]
137 questions
42
votes
2 answers
How to properly remove event listeners in node js eventemitter
I have a set up with a GET and a POST route, the idea being that POSTing to the route triggers an event, and the GET route is a server-sent eventstream which fires each time the POSTed event is triggered... however, i think i've done something wrong…

coffeedoughnuts
- 505
- 1
- 5
- 12
30
votes
4 answers
Gulp.js event stream merge order
I am trying to merge css and scss files into a main.css file that goes in my build directory.
Its working, but not in the right order. The style attributes from the scss files need to be in the bottom of the main.css file so they overrule the…

Jabba Da Hoot
- 794
- 2
- 7
- 16
28
votes
3 answers
Event Stream data not showing in Chrome console
I have an EventSource listener on my frontend calling a complicated backend scheme. This code block is written in Typescript.
import * as EventSource from 'eventsource';
private streamData() {
let source = new…

plavz
- 281
- 1
- 3
- 4
28
votes
1 answer
Server sent event EventStream does not trigger "onmessage" but Chrome Debug shows data in "EventStream" tab
I'm using SSE with the EventStream built in logic for javascript. While having onopen return a successful result the onmessage callback is not working.
Odd thing here is that within Chrome in the EventStream tab the data results are listed as I…

xetra11
- 7,671
- 14
- 84
- 159
18
votes
1 answer
ActionController::Live Is it possible to check if connection is still alive?
I'm trying to implement text/event-stream using Rails 4's Live streaming. It works great and the only trouble I met is that I can't check if the connection is alive without sending any messages.
The only solution I figured out is to make supportive…

Ivan Yurov
- 1,578
- 10
- 27
14
votes
2 answers
Why is EventSource connection closed every 30-60 sec when no data transported, while WebSocket's one is kept open?
I would like to push data to users every 2 min. Using EventSource requires additional pushing null-byte every 29 sec to keep the connection open. WebSocket doesn't require such ping. Why is the EventSource connection regularly closed and reopened?…

Andrei
- 10,918
- 12
- 76
- 110
10
votes
1 answer
Flask sse-stream not terminated after firefox disconnects
I am trying to create a Flask server that streams data to the client using sse. The piece of test-code below seems to do the trick, but I stumbled upon a problem related to handling client disconnects.
When using Firefox as the client (versions 28…

mojoritty
- 153
- 8
7
votes
1 answer
Loading an eventstream through Gunicorn + Flask
I'm trying to generate a large PDF using a Flask application. The pdf generation involves generating ten long pdfs, and then merging them together. The application runs using Gunicorn with the flags: --worker-class gevent --workers 2.
Here's what my…

Adam Steele
- 256
- 2
- 10
7
votes
3 answers
Event Source -> Server returns event stream in bulk rather then returning in chunk
I have a php script that import large data from csv files with validations.
For that I need to show progress to the user. I have used Event Streaming for that.
When I echo something, I want it to be transferred to client one by one…

ba1ar
- 534
- 5
- 22
6
votes
2 answers
How to stream data over socket.io to client
I have socket.io sending a basic object from server to client. This bit works fine.
Now want to send a stream from server to client, using event-stream (specifically the results of a block-chain query). I am getting unexpected results in the browser…

Colin
- 930
- 3
- 19
- 42
6
votes
1 answer
Getting information about an error with EventSource
I'm trying to get information about an error when using EventSource in NodeJs, I think you could understand me better with the following example:
var url = 'http://api.example.com/resource'
var EventSource = require('eventsource');
var es = new…

Gepser Hoil
- 3,998
- 4
- 24
- 34
5
votes
2 answers
Cache problem? Server side events work in localhost, not in production enviroment
I want to ask this question with a simply example. (I will write down at the end of the post).
I have read this:
server sent events not updating until script is finished
But I don't know how to solve it.
With the solution of its answer…

Juan Rangel
- 83
- 6
5
votes
1 answer
PHP Server Sent Events Connection won't close?
I have implemented a server sent events with eventsource on my web application.
Basically in javascript my code look like :
var myEventSource;
if (typeof(EventSource) !== "undefined" &&…

Jordan Daigle
- 424
- 4
- 12
5
votes
0 answers
Docker container blocking text/event-stream
I am working with Docker containers and live streaming of text/event-stream events. I am using this example here. When I deploy that example as a Java EE WAR on a TomCat server on my local machine, everything works fine, and I see the Webpage…

Ambidextrous
- 810
- 6
- 14
5
votes
0 answers
javascript: what is the difference between channels and observables
What is the difference between channels (https://github.com/ubolonton/js-csp) and observables (https://rpominov.github.io/kefir/)? Are there specific use cases where using one would make more sense than using the other?

tldr
- 11,924
- 15
- 75
- 120