You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by gdamjan <gi...@git.apache.org> on 2016/02/09 19:11:27 UTC

[GitHub] couchdb-couch pull request: Send a real EventSource event for hear...

GitHub user gdamjan opened a pull request:

    https://github.com/apache/couchdb-couch/pull/137

    Send a real EventSource event for heartbeat

    Bring back 845bf7529a3bc565d6446a7fa6cc5fd1a140653e
    
    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.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gdamjan/couchdb-couch master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-couch/pull/137.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #137
    
----
commit 11896807f1d27eee8789cee36bdf2c38ede42916
Author: Damjan Georgievski <gd...@gmail.com>
Date:   2014-05-02T15:04:41Z

    Send a real EventSource event for heartbeat
    
    Bring back 845bf7529a3bc565d6446a7fa6cc5fd1a140653e
    
    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.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Send a real EventSource event for hear...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/137#issuecomment-182204136
  
    Why it was removed?
    +1 to get it back.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Send a real EventSource event for hear...

Posted by kxepal <gi...@git.apache.org>.
Github user kxepal commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/137#issuecomment-184857209
  
    Merged, thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Send a real EventSource event for hear...

Posted by gdamjan <gi...@git.apache.org>.
Github user gdamjan commented on the pull request:

    https://github.com/apache/couchdb-couch/pull/137#issuecomment-182417963
  
    seems to have been removed by mistake in da2836b6afa4fcb96a18bff5f32f5ac3d6376de8


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] couchdb-couch pull request: Send a real EventSource event for hear...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/couchdb-couch/pull/137


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---