Skip to content
This repository

Documenting 'end' and 'destroy' events for Streaming API #21

Merged
merged 1 commit into from over 2 years ago

2 participants

Yin Shanyang Charlie McConnell
Yin Shanyang

Documenting the 'destroy' event for Streaming API, which is emitted
when Twitter silently disconnects.

Documenting 'end' and 'destroy' events for Streaming API
Documenting the 'destroy' event for Streaming API, which is emitted
when Twitter silently disconnects.
7b1c086
Charlie McConnell AvianFlu merged commit 0ceebcd into from November 26, 2011
Charlie McConnell AvianFlu closed this November 26, 2011
Charlie McConnell
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Nov 26, 2011
Documenting 'end' and 'destroy' events for Streaming API
Documenting the 'destroy' event for Streaming API, which is emitted
when Twitter silently disconnects.
7b1c086
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  README.md
6  README.md
Source Rendered
@@ -88,6 +88,12 @@ ntwitter also supports user and site streams:
88 88
           stream.on('data', function (data) {
89 89
             console.log(console.dir(data));
90 90
           });
  91
+          stream.on('end', function (response) {
  92
+            // Handle a disconnection
  93
+          });
  94
+          stream.on('destroy', function (response) {
  95
+            // Handle a 'silent' disconnection from Twitter, no end/error event fired
  96
+          });
91 97
           // Disconnect stream after five seconds
92 98
           setTimeout(stream.destroy, 5000);
93 99
         });
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.