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

Override default maxSockets to Infinity #42

Merged
merged 4 commits into from Aug 29, 2014
Merged

Override default maxSockets to Infinity #42

merged 4 commits into from Aug 29, 2014

Conversation

@geek
Copy link
Member

geek commented Aug 28, 2014

Closes #41

@geek geek added this to the 4.0.0 milestone Aug 28, 2014
if (options.agent) {

// When false then agent pooling is disabled
if (options.agent || options.agent === false) {

This comment has been minimized.

Copy link
@hueniverse

hueniverse Aug 28, 2014

Member

false option is not in the docs

uri.agent = options.agent;
}
else {
uri.agent = client.globalAgent;

This comment has been minimized.

Copy link
@hueniverse

hueniverse Aug 28, 2014

Member

Nope. See the hapi proxy code for created agents when maxSockets is set. We never want to change the global agent.

@@ -17,11 +17,19 @@ var Tap = require('./tap');
var internals = {};


exports.agents = {
https: new Https.Agent({ maxSockets: Infinity }),

This comment has been minimized.

Copy link
@arb

arb Aug 29, 2014

Contributor

What about merging the global agent with this so that the default wreck agent is essentially the same as the global one just with the max sockets set to Infinity? In case users set some other property they want wreck to use via the global agent.

Thoughts?

This comment has been minimized.

Copy link
@geek

geek Aug 29, 2014

Author Member

Its a good idea, but in node 0.10 there is only one option when constructing the Agent: https://github.com/joyent/node/blob/v0.10.31-release/lib/http.js#L1229

For now I vote keep it as is, in node 0.11 if someone needs to change any of these options they still can

hueniverse added a commit that referenced this pull request Aug 29, 2014
Override default maxSockets to Infinity
@hueniverse hueniverse merged commit 3773831 into hapijs:master Aug 29, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
@hueniverse

This comment has been minimized.

Copy link
Member

hueniverse commented Aug 29, 2014

Need a hapi PR to move to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.