This repository has been archived by the owner. It is now read-only.

HTTP Better #5615

Closed
wants to merge 5 commits into
from

Conversation

Projects
None yet
3 participants
@isaacs

isaacs commented May 31, 2013

Adds keepalive, but only via creating an Agent and turning it on explicitly. Other than that, mostly cleanup and code organization. There's more to be done, but it's mergeworthy now, imo.

+ sets.forEach(function(set) {
+ Object.keys(set).forEach(function(name) {
+ set[name].forEach(function(socket) {
+ socket.destroy();

This comment has been minimized.

@isaacs

isaacs May 31, 2013

Perhaps this should be destroySoon? Or maybe the Agent should have a destroySoon method?

@isaacs

isaacs May 31, 2013

Perhaps this should be destroySoon? Or maybe the Agent should have a destroySoon method?

This comment has been minimized.

@tjfontaine

tjfontaine Jul 1, 2013

Using destroy seems sane, because if I wanted to gracefully close the pool I could just set maxSockets to 0

@tjfontaine

tjfontaine Jul 1, 2013

Using destroy seems sane, because if I wanted to gracefully close the pool I could just set maxSockets to 0

@tjfontaine

This comment has been minimized.

Show comment
Hide comment
@tjfontaine

tjfontaine Jul 1, 2013

this lgtm, I think we should merge this asap to get some wider testing done on it

this lgtm, I think we should merge this asap to get some wider testing done on it

- } else {
- self.onSocket(net.createConnection(self.socketPath));
- }
+ var conn = self.agent.createConnection({ path: self.socketPath });

This comment has been minimized.

@TooTallNate

TooTallNate Jul 8, 2013

Is .agent always going to be set at this point? (I ask because the conditional right below this one checks for if (self.agent))

@TooTallNate

TooTallNate Jul 8, 2013

Is .agent always going to be set at this point? (I ask because the conditional right below this one checks for if (self.agent))

isaacs added some commits May 15, 2013

http: Proper KeepAlive behavior
Instead of destroying sockets when there are no pending requests, put
them in a freeSockets list, and unref() them so that they do not keep
the event loop open.

Also, set the default max sockets to Infinity, to prevent the awful
surprising deadlocks that happen when more connections are made.
http: Use OOP for OutgoingMessage._finish
Sniffing instanceof a child class in the parent class's method
is Doing It Wrong.
@isaacs

This comment has been minimized.

Show comment
Hide comment
@isaacs

isaacs Jul 25, 2013

landed in master

isaacs commented Jul 25, 2013

landed in master

@isaacs isaacs closed this Jul 25, 2013

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.