Code Monkey home page Code Monkey logo

Comments (7)

Fabryz avatar Fabryz commented on August 16, 2024

I have now created 2x Twitter applications: one for the production environment and one for the development environment, set on different URLS so I think it should work, will see.

Is there a way to manually stop the streaming client? At the moment I just cleared the client variable, like tu = "", but I guess there's something more to do?

from tuiter.

mef avatar mef commented on August 16, 2024

I think it should work, will see.

Indeed, opening only one connection per application is likely to solve your problem

Is there a way to manually stop the streaming client? At the moment I just cleared the client variable, like tu = "", but I guess there's something more to do?

The way to do this is explained in README.md:

Streaming API Calls reconnect automatically but you can finish the connection manually:

    tu.filter({track: "milanesa"}, function(stream){

      setTimeout(function(){      
        stream.emit('end');
      }, 2 * 3 * 4);
    });

from tuiter.

Fabryz avatar Fabryz commented on August 16, 2024

Dang, I missed it, thanks

from tuiter.

Fabryz avatar Fabryz commented on August 16, 2024

Reopening because I still have this issue while developing.

  • Are you sure all existing connection are closed/destroyed once Twitter answer with the rateLimiter and/or you firing the autoreconnect?

https://dev.twitter.com/discussions/9561

  • In some cases, that I have to pinpoint, It keeps to continue to start, some logs (redirected your debug function to console.log):

    Creating Tuiter object
    Tuiter object created
    Tuiter#filter method called
    processing query parameters
    Starting API call for https://stream.twitter.com/1.1/statuses/filter.json
    2013-05-05T12:47:12.179Z* Stream started // <- my console.log so you can see the timestamp
    Succesfully connected. Start streaming data
    2013-05-05T12:47:12.659Z* Stream started
    Succesfully connected. Start streaming data
    2013-05-05T12:47:13.015Z* Stream started
    2013-05-05T12:47:13.713Z* Stream started
    Succesfully connected. Start streaming data
    Succesfully connected. Start streaming data

  • in case of HTTP errors it says that it will reconnect in X seconds, instead it tries again the next tick (after 1 sec)

    2013-05-05T12:50:45.211Z* Stream started
    http error encountered. Will reconnect after 5000 miliseconds.
    2013-05-05T12:50:46.036Z* Stream started
    http error encountered. Will reconnect after 5250 miliseconds.
    2013-05-05T12:50:46.941Z* Stream started
    http error encountered. Will reconnect after 5500 miliseconds.
    2013-05-05T12:50:47.719Z* Stream started
    http error encountered. Will reconnect after 5750 miliseconds.
    2013-05-05T12:50:48.554Z* Stream started
    ...
    ...
    http error encountered. Will reconnect after 9500 miliseconds.
    2013-05-05T12:51:00.850Z* Stream started
    http error encountered. Will reconnect after 9750 miliseconds.
    2013-05-05T12:51:01.580Z* Stream started
    http error encountered. Will reconnect after 10000 miliseconds.
    2013-05-05T12:51:02.422Z* Stream started
    http error encountered. Will reconnect after 10250 miliseconds.
    2013-05-05T12:51:03.288Z* Stream started

Same on "Easy there Turbo..."

processing query parameters
Starting API call for https://stream.twitter.com/1.1/statuses/filter.json
2013-05-05T13:07:08.130Z* Stream started
rate limit error encountered. Will reconnect after 60000 miliseconds.
Stream ERR: Error: Bad token: Easy there, Turbo. Too many requests recently. Enhance your calm.

2013-05-05T13:07:10.755Z* Stream started
rate limit error encountered. Will reconnect after 60000 miliseconds.
Stream ERR: Error: Bad token: Easy there, Turbo. Too many requests recently. Enhance your calm.

2013-05-05T13:07:19.122Z* Stream started
rate limit error encountered. Will reconnect after 120000 miliseconds.
Stream ERR: Error: Bad token: Easy there, Turbo. Too many requests recently. Enhance your calm.

Says it will reconnect after X, instead it tries again on the next tick and doubles the time

For now to overcome these restart loops I need to restart the node server every time.

from tuiter.

impronunciable avatar impronunciable commented on August 16, 2024

Thanks for the details, I'll take a look at this. Which version of node are you using? I'm currently having some difficulties with node v0.10.x

from tuiter.

Fabryz avatar Fabryz commented on August 16, 2024

I think that on that environment i'm using Node v0.8.2x, I have issues too with v0.10.x + Tuiter so I'll hang on the older one until they will be fixed.

from tuiter.

impronunciable avatar impronunciable commented on August 16, 2024

Tested with tuiter 0.2.10 on node v0.10.12 (latest node version). Thanks for reporing.

from tuiter.

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.