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

Set maxSockets to Infinity by default #30

Merged
merged 1 commit into from
Jan 4, 2015
Merged

Set maxSockets to Infinity by default #30

merged 1 commit into from
Jan 4, 2015

Conversation

floatdrop
Copy link
Contributor

Setting agent for requests to new http(s).Agent({maxSockets: Infinity})

This will get same maxSockets value in 0.10 and upcoming 0.12 node as @julien-f suggested.

Closes #22

@floatdrop
Copy link
Contributor Author

Squashed commits. Ready for review.


You can read more about in [why pooling is evil](https://github.com/substack/hyperquest#pooling-is-evil).

To use default agent just pass `undefined` to this option.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better to recommend null rather than undefined.

@floatdrop floatdrop changed the title Fix maxSockets problem Set maxSockets to Infinity by default Jan 3, 2015
@floatdrop
Copy link
Contributor Author

Rebased.

@floatdrop
Copy link
Contributor Author

Incapsulated Node logic of creating https agent to infinity-agent module.

var read = require('read-all-stream');
var timeout = require('timed-out');
var urlLib = require('url');
var zlib = require('zlib');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting yak

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

sindresorhus added a commit that referenced this pull request Jan 4, 2015
Set maxSockets to Infinity by default
@sindresorhus sindresorhus merged commit 939534d into sindresorhus:master Jan 4, 2015
@sindresorhus
Copy link
Owner

$ npm i -g superb
$ superb
groovy

@floatdrop floatdrop deleted the fix-agent branch January 4, 2015 18:09
@floatdrop
Copy link
Contributor Author

\o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default agent is limited with 5 sockets
2 participants