Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeouts on requests #19

Open
acasas opened this issue May 18, 2016 · 0 comments
Open

Timeouts on requests #19

acasas opened this issue May 18, 2016 · 0 comments
Labels

Comments

@acasas
Copy link
Contributor

acasas commented May 18, 2016

Are you guys considering adding timeouts to the requests made in the library? My understanding is that there is no timeouts in superagent, and therefore some requests might never end, which is something that I am seeing happening in mobile env with not a great connectivity.

A possibility would be to extend the Defaults with a timeout, that would be applied to the request in the _request(), and that I could override when creating the Particle object in my app:

particle = new Particle({
    baseUrl: 'https://api.particle.io',
    clientSecret: 'particle-api',
    clientId: 'particle-api',
    tokenDuration: 7776000, // 90 days
    timeout: 5000
  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants