diff options
| author | Damjan Georgievski <gdamjan@gmail.com> | 2014-05-02 17:04:41 +0200 |
|---|---|---|
| committer | Klaus Trainer <klaus_trainer@apache.org> | 2014-05-13 14:53:42 +0200 |
| commit | 95600b70e6cd36e460cc06958f624954419aa9e1 (patch) | |
| tree | 54d78e4777acc2bec7c7c380623568d775bea93e /src/Makefile.am | |
| parent | 7fe850914d9230e164209eff7255df4c3bc54983 (diff) | |
| download | couchdb-95600b70e6cd36e460cc06958f624954419aa9e1.tar.gz | |
Send a real EventSource event for heartbeat
The EventSource connection can get stuck (in TCP half-open state*) and there's no way
for the client to detect that. This commit changes the way heartbeat is sent, instead of
sending a newline character, it sends an empty event of type heartbeat:
event: heartbeat
data:
This event doesn't have an id: field, so the client will retain its latest Last-Event-ID state.
This doesn't change the expectations of clients that used EventSource till now, because they
subscribe to the 'message' event type. To get the 'heartbeat' events a client will need to
explicitly subscribe to it:
source.addEventListener('heartbeat', function () { /* cancel a timer that would otherwise reconnect the source */ });
* this can happen when you suspend your laptop, on flaky internet connection, ADSL reconnect,
bad wifi signals, bad routers etc. Pretty often in a typical internet usage nowadays.
Diffstat (limited to 'src/Makefile.am')
0 files changed, 0 insertions, 0 deletions
