Giter Site home page Giter Site logo

Comments (3)

zane-programs avatar zane-programs commented on August 23, 2024 1

Interestingly, this quirk does not just occur after restarts. In fact, I just applied for a new Twitter Developer account on my Twitter alt account, and I ran into the stream disconnect issue on my very first use of the new keys.

I don't think this is on @HunterLarco though; it seems to be a quirk with Twitter's streaming API itself. Alas, I'll be polling Twitter for now instead.

from twitter-v2.

zane-programs avatar zane-programs commented on August 23, 2024

I can confirm that I am having the same issue. It seems to be due to ratelimiting on the part of Twitter. Has anyone else experienced this behavior?

from twitter-v2.

HunterLarco avatar HunterLarco commented on August 23, 2024

Unfortunately @zane-programs is correct. Twitter rate limits all streams such that if you're frequently connecting and reconnecting you'll run into a ConnectionException.

Note that:

Each app is allowed one connected client at a time. You can attempt reconnecting up to 15 times per 15 minute period. You can make up to 450 rule changes per 15 minute period.

and

To check connection limits response will return three headers: x-rate-limit-limit, x-rate-limit-remaining and x-rate-limit-reset headers. This is useful to understand how many times you can use the rule endpoint, and how many reconnections attempts are allowed for the streaming endpoint.

If your dev workflow requires several restarts within a 15min period you may want to consider streaming from Twitter with a different process which your binary connects to instead. EG: create a thin JS client that connects to twitter and proxies all streamed data. In fact, that might not be a bad thing to add to this repository as a utility if there's enough interest.

from twitter-v2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.