tessel / t1-runtime

[UNMAINTAINED] Tessel 1 JavaScript runtime.
Other
117 stars 33 forks source link

Set default Agent's initial maxSockets to 1 #680

Closed natevw closed 9 years ago

natevw commented 9 years ago

The new rationale here is that:

@LinusU how does this sound as a replacement for #675?

LinusU commented 9 years ago

I think 1 is sane since we have such a limited number of connections on the tessel.

The only downside is not being able to make parallel http requests. I guess it would be very cool if socket queueing could be handled at an lower level which would allocate sockets to the different parts (net/dgram/http, Server/Client). A program recording data from senors and sending to different apis would get 3 http.Client and 1 dns socket. A small web server would get 4 sockets for incoming connections. I guess it might be a bit complicated to figure out how it should work thought...

LGTM

@johnnyman727 is switching to the CC3100 on the roadmap?

natevw commented 9 years ago

Sounds like everyone's content with this then? Can someone r+.

@LinusU Users are still welcome to e.g. require('http').globalAgent.maxSockets = 4 (or provide an equivalent agent to all requests) if they would like a different setting for their app; we're just aiming for the best "out-of-box" default here.

johnnyman727 commented 9 years ago

@natevw can we rebase the first commit out of this PR for cleanliness?

tm-rampart commented 9 years ago

Approved by @tcr. Running tests.