Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

create one keepalive agent per pool #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Matt-Esch
Copy link
Contributor

As the keepalive agent indexes sockets on a host:port basis, there is no need to create a keepalive agent per pool endpoint. This diff creates a keepalive agent on the pool and passes it into the pool_endpoint on creation.

cc: @rf @Raynos

@CLAassistant
Copy link

CLAassistant commented Dec 20, 2016

CLA assistant check
All committers have signed the CLA.

throw new Error("invalid http module");
}
if (! Array.isArray(endpoints)) {
throw new Error("endpoints must be an array");
}
this.http = http;
this.protocol = protocol;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: property name http is more clearly a module to me than protocol which sounds like it is going to be a string "http" or "https"

@@ -309,7 +323,7 @@ Pool.prototype.add_endpoint = function (host_port) {
var ip = ip_port[0];
var port = +ip_port[1];
if (port > 0 && port < 65536) {
var endpoint = new GO.PoolEndpoint(this.http, ip, port, this.options);
var endpoint = new GO.PoolEndpoint(this.protocol, ip, port, this.options);
Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like you intended for agent to be a property of options but I don't see that anywhere

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

Successfully merging this pull request may close these issues.

4 participants