cstephen / hashtag-count

Count hashtag occurrences over time using Twitter's Streaming API.
MIT License
7 stars 4 forks source link

Report Twitter Streaming API disconnects and attempt to reconnect #2

Closed cstephen closed 7 years ago

cstephen commented 7 years ago

Although Twitter's Streaming API connections are designed to remain open indefinitely, there are several reasons a client can be disconnected:

See the "Disconnections" section of this page for a more complete list.

Currently, if this module gets disconnected from Twitter's Streaming API, it continues to run like nothing happened except that all hashtag counts show up as 0. This needs to be fixed. This module should:

cstephen commented 7 years ago

This has been resolved. Results are disabled while the module is in a disconnected state to avoid false 0 results. Support for three new optional callback functions, 'connectingCb,reconnectingCb, andconnectedCb`, has been added to allow applications to react to connect/disconnect events in any way.