{"action":"created","comment":{"url":"https://api.github.com/repos/launchdarkly/go-client/pulls/comments/35355152","id":35355152,"diff_hunk":"@@ -104,9 +105,21 @@ func MakeCustomClient(apiKey string, config Config) LDClient {\n \tvar streamProcessor *StreamProcessor\n \n \tconfig.BaseUri = strings.TrimRight(config.BaseUri, \"/\")\n-\thttpClient := httpcache.NewMemoryCacheTransport().Client()\n-\t// Client Transport of type *httpcache.Transport doesn't support CancelRequest; Timeout not supported\n-\t// httpClient.Timeout = config.Timeout\n+\n+\tbaseTransport := httpcontrol.Transport{\n+\t\tRequestTimeout: config.Timeout,\n+\t\tDialTimeout:    config.Timeout,\n+\t\tDialKeepAlive:  2 * time.Minute,","path":"ldclient.go","position":19,"original_position":19,"commit_id":"2e2512a137afe317da2d4d13d1020cbcf7abf472","original_commit_id":"2e2512a137afe317da2d4d13d1020cbcf7abf472","user":{"login":"pkaeding","id":13951,"avatar_url":"https://avatars.githubusercontent.com/u/13951?v=3","gravatar_id":"","url":"https://api.github.com/users/pkaeding","html_url":"https://github.com/pkaeding","followers_url":"https://api.github.com/users/pkaeding/followers","following_url":"https://api.github.com/users/pkaeding/following{/other_user}","gists_url":"https://api.github.com/users/pkaeding/gists{/gist_id}","starred_url":"https://api.github.com/users/pkaeding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkaeding/subscriptions","organizations_url":"https://api.github.com/users/pkaeding/orgs","repos_url":"https://api.github.com/users/pkaeding/repos","events_url":"https://api.github.com/users/pkaeding/events{/privacy}","received_events_url":"https://api.github.com/users/pkaeding/received_events","type":"User","site_admin":false},"body":"I'm pretty sure this is longer than fastly (or haproxy) will allow a connection to be help open.","created_at":"2015-07-23T18:32:30Z","updated_at":"2015-07-23T18:32:30Z","html_url":"https://github.com/launchdarkly/go-client/pull/17#discussion_r35355152","pull_request_url":"https://api.github.com/repos/launchdarkly/go-client/pulls/17","_links":{"self":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/comments/35355152"},"html":{"href":"https://github.com/launchdarkly/go-client/pull/17#discussion_r35355152"},"pull_request":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/17"}}},"pull_request":{"url":"https://api.github.com/repos/launchdarkly/go-client/pulls/17","id":40658586,"html_url":"https://github.com/launchdarkly/go-client/pull/17","diff_url":"https://github.com/launchdarkly/go-client/pull/17.diff","patch_url":"https://github.com/launchdarkly/go-client/pull/17.patch","issue_url":"https://api.github.com/repos/launchdarkly/go-client/issues/17","number":17,"state":"open","locked":false,"title":"Replace base transport with Facebook's implementation","user":{"login":"jkodumal","id":19426,"avatar_url":"https://avatars.githubusercontent.com/u/19426?v=3","gravatar_id":"","url":"https://api.github.com/users/jkodumal","html_url":"https://github.com/jkodumal","followers_url":"https://api.github.com/users/jkodumal/followers","following_url":"https://api.github.com/users/jkodumal/following{/other_user}","gists_url":"https://api.github.com/users/jkodumal/gists{/gist_id}","starred_url":"https://api.github.com/users/jkodumal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkodumal/subscriptions","organizations_url":"https://api.github.com/users/jkodumal/orgs","repos_url":"https://api.github.com/users/jkodumal/repos","events_url":"https://api.github.com/users/jkodumal/events{/privacy}","received_events_url":"https://api.github.com/users/jkodumal/received_events","type":"User","site_admin":false},"body":"Facebook's httpcontrol has finer-grained controls for timeouts as well as support for connection pooling. This still needs to be tested thoroughly. \r\n\r\nAt first, I attempted to use facebook's http caching transport as well. However, I noticed that the interface is far less flexible than the gregjones implementation. It does not let you look at both request and response headers to make caching decisions. For example, you probably want to base staleness calculations based on the Date header in responses, but you cannot do that with the facebook interface.\r\n\r\nI also found that there are no default implementations for the interfaces needed in the facebook caching library. For example, you need to build your own in-memory store. You also need to bring your own logic for making staleness calculations (parsing headers, etc.).","created_at":"2015-07-23T10:43:23Z","updated_at":"2015-07-23T18:32:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01dbcff0068dd261ec36a856c5d02a987736556e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/launchdarkly/go-client/pulls/17/commits","review_comments_url":"https://api.github.com/repos/launchdarkly/go-client/pulls/17/comments","review_comment_url":"https://api.github.com/repos/launchdarkly/go-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/launchdarkly/go-client/issues/17/comments","statuses_url":"https://api.github.com/repos/launchdarkly/go-client/statuses/2e2512a137afe317da2d4d13d1020cbcf7abf472","head":{"label":"launchdarkly:jko/replace-transport","ref":"jko/replace-transport","sha":"2e2512a137afe317da2d4d13d1020cbcf7abf472","user":{"login":"launchdarkly","id":8039656,"avatar_url":"https://avatars.githubusercontent.com/u/8039656?v=3","gravatar_id":"","url":"https://api.github.com/users/launchdarkly","html_url":"https://github.com/launchdarkly","followers_url":"https://api.github.com/users/launchdarkly/followers","following_url":"https://api.github.com/users/launchdarkly/following{/other_user}","gists_url":"https://api.github.com/users/launchdarkly/gists{/gist_id}","starred_url":"https://api.github.com/users/launchdarkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/launchdarkly/subscriptions","organizations_url":"https://api.github.com/users/launchdarkly/orgs","repos_url":"https://api.github.com/users/launchdarkly/repos","events_url":"https://api.github.com/users/launchdarkly/events{/privacy}","received_events_url":"https://api.github.com/users/launchdarkly/received_events","type":"Organization","site_admin":false},"repo":{"id":24306448,"name":"go-client","full_name":"launchdarkly/go-client","owner":{"login":"launchdarkly","id":8039656,"avatar_url":"https://avatars.githubusercontent.com/u/8039656?v=3","gravatar_id":"","url":"https://api.github.com/users/launchdarkly","html_url":"https://github.com/launchdarkly","followers_url":"https://api.github.com/users/launchdarkly/followers","following_url":"https://api.github.com/users/launchdarkly/following{/other_user}","gists_url":"https://api.github.com/users/launchdarkly/gists{/gist_id}","starred_url":"https://api.github.com/users/launchdarkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/launchdarkly/subscriptions","organizations_url":"https://api.github.com/users/launchdarkly/orgs","repos_url":"https://api.github.com/users/launchdarkly/repos","events_url":"https://api.github.com/users/launchdarkly/events{/privacy}","received_events_url":"https://api.github.com/users/launchdarkly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/launchdarkly/go-client","description":"Golang SDK for LaunchDarkly","fork":false,"url":"https://api.github.com/repos/launchdarkly/go-client","forks_url":"https://api.github.com/repos/launchdarkly/go-client/forks","keys_url":"https://api.github.com/repos/launchdarkly/go-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/launchdarkly/go-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/launchdarkly/go-client/teams","hooks_url":"https://api.github.com/repos/launchdarkly/go-client/hooks","issue_events_url":"https://api.github.com/repos/launchdarkly/go-client/issues/events{/number}","events_url":"https://api.github.com/repos/launchdarkly/go-client/events","assignees_url":"https://api.github.com/repos/launchdarkly/go-client/assignees{/user}","branches_url":"https://api.github.com/repos/launchdarkly/go-client/branches{/branch}","tags_url":"https://api.github.com/repos/launchdarkly/go-client/tags","blobs_url":"https://api.github.com/repos/launchdarkly/go-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/launchdarkly/go-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/launchdarkly/go-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/launchdarkly/go-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/launchdarkly/go-client/statuses/{sha}","languages_url":"https://api.github.com/repos/launchdarkly/go-client/languages","stargazers_url":"https://api.github.com/repos/launchdarkly/go-client/stargazers","contributors_url":"https://api.github.com/repos/launchdarkly/go-client/contributors","subscribers_url":"https://api.github.com/repos/launchdarkly/go-client/subscribers","subscription_url":"https://api.github.com/repos/launchdarkly/go-client/subscription","commits_url":"https://api.github.com/repos/launchdarkly/go-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/launchdarkly/go-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/launchdarkly/go-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/launchdarkly/go-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/launchdarkly/go-client/contents/{+path}","compare_url":"https://api.github.com/repos/launchdarkly/go-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/launchdarkly/go-client/merges","archive_url":"https://api.github.com/repos/launchdarkly/go-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/launchdarkly/go-client/downloads","issues_url":"https://api.github.com/repos/launchdarkly/go-client/issues{/number}","pulls_url":"https://api.github.com/repos/launchdarkly/go-client/pulls{/number}","milestones_url":"https://api.github.com/repos/launchdarkly/go-client/milestones{/number}","notifications_url":"https://api.github.com/repos/launchdarkly/go-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/launchdarkly/go-client/labels{/name}","releases_url":"https://api.github.com/repos/launchdarkly/go-client/releases{/id}","created_at":"2014-09-21T22:22:55Z","updated_at":"2015-06-04T15:00:45Z","pushed_at":"2015-07-23T10:43:23Z","git_url":"git://github.com/launchdarkly/go-client.git","ssh_url":"git@github.com:launchdarkly/go-client.git","clone_url":"https://github.com/launchdarkly/go-client.git","svn_url":"https://github.com/launchdarkly/go-client","homepage":null,"size":441,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"launchdarkly:jko/sse","ref":"jko/sse","sha":"fdea4391660a4b62c3d164910863689b34ce7309","user":{"login":"launchdarkly","id":8039656,"avatar_url":"https://avatars.githubusercontent.com/u/8039656?v=3","gravatar_id":"","url":"https://api.github.com/users/launchdarkly","html_url":"https://github.com/launchdarkly","followers_url":"https://api.github.com/users/launchdarkly/followers","following_url":"https://api.github.com/users/launchdarkly/following{/other_user}","gists_url":"https://api.github.com/users/launchdarkly/gists{/gist_id}","starred_url":"https://api.github.com/users/launchdarkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/launchdarkly/subscriptions","organizations_url":"https://api.github.com/users/launchdarkly/orgs","repos_url":"https://api.github.com/users/launchdarkly/repos","events_url":"https://api.github.com/users/launchdarkly/events{/privacy}","received_events_url":"https://api.github.com/users/launchdarkly/received_events","type":"Organization","site_admin":false},"repo":{"id":24306448,"name":"go-client","full_name":"launchdarkly/go-client","owner":{"login":"launchdarkly","id":8039656,"avatar_url":"https://avatars.githubusercontent.com/u/8039656?v=3","gravatar_id":"","url":"https://api.github.com/users/launchdarkly","html_url":"https://github.com/launchdarkly","followers_url":"https://api.github.com/users/launchdarkly/followers","following_url":"https://api.github.com/users/launchdarkly/following{/other_user}","gists_url":"https://api.github.com/users/launchdarkly/gists{/gist_id}","starred_url":"https://api.github.com/users/launchdarkly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/launchdarkly/subscriptions","organizations_url":"https://api.github.com/users/launchdarkly/orgs","repos_url":"https://api.github.com/users/launchdarkly/repos","events_url":"https://api.github.com/users/launchdarkly/events{/privacy}","received_events_url":"https://api.github.com/users/launchdarkly/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/launchdarkly/go-client","description":"Golang SDK for LaunchDarkly","fork":false,"url":"https://api.github.com/repos/launchdarkly/go-client","forks_url":"https://api.github.com/repos/launchdarkly/go-client/forks","keys_url":"https://api.github.com/repos/launchdarkly/go-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/launchdarkly/go-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/launchdarkly/go-client/teams","hooks_url":"https://api.github.com/repos/launchdarkly/go-client/hooks","issue_events_url":"https://api.github.com/repos/launchdarkly/go-client/issues/events{/number}","events_url":"https://api.github.com/repos/launchdarkly/go-client/events","assignees_url":"https://api.github.com/repos/launchdarkly/go-client/assignees{/user}","branches_url":"https://api.github.com/repos/launchdarkly/go-client/branches{/branch}","tags_url":"https://api.github.com/repos/launchdarkly/go-client/tags","blobs_url":"https://api.github.com/repos/launchdarkly/go-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/launchdarkly/go-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/launchdarkly/go-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/launchdarkly/go-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/launchdarkly/go-client/statuses/{sha}","languages_url":"https://api.github.com/repos/launchdarkly/go-client/languages","stargazers_url":"https://api.github.com/repos/launchdarkly/go-client/stargazers","contributors_url":"https://api.github.com/repos/launchdarkly/go-client/contributors","subscribers_url":"https://api.github.com/repos/launchdarkly/go-client/subscribers","subscription_url":"https://api.github.com/repos/launchdarkly/go-client/subscription","commits_url":"https://api.github.com/repos/launchdarkly/go-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/launchdarkly/go-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/launchdarkly/go-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/launchdarkly/go-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/launchdarkly/go-client/contents/{+path}","compare_url":"https://api.github.com/repos/launchdarkly/go-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/launchdarkly/go-client/merges","archive_url":"https://api.github.com/repos/launchdarkly/go-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/launchdarkly/go-client/downloads","issues_url":"https://api.github.com/repos/launchdarkly/go-client/issues{/number}","pulls_url":"https://api.github.com/repos/launchdarkly/go-client/pulls{/number}","milestones_url":"https://api.github.com/repos/launchdarkly/go-client/milestones{/number}","notifications_url":"https://api.github.com/repos/launchdarkly/go-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/launchdarkly/go-client/labels{/name}","releases_url":"https://api.github.com/repos/launchdarkly/go-client/releases{/id}","created_at":"2014-09-21T22:22:55Z","updated_at":"2015-06-04T15:00:45Z","pushed_at":"2015-07-23T10:43:23Z","git_url":"git://github.com/launchdarkly/go-client.git","ssh_url":"git@github.com:launchdarkly/go-client.git","clone_url":"https://github.com/launchdarkly/go-client.git","svn_url":"https://github.com/launchdarkly/go-client","homepage":null,"size":441,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/17"},"html":{"href":"https://github.com/launchdarkly/go-client/pull/17"},"issue":{"href":"https://api.github.com/repos/launchdarkly/go-client/issues/17"},"comments":{"href":"https://api.github.com/repos/launchdarkly/go-client/issues/17/comments"},"review_comments":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/17/comments"},"review_comment":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/launchdarkly/go-client/pulls/17/commits"},"statuses":{"href":"https://api.github.com/repos/launchdarkly/go-client/statuses/2e2512a137afe317da2d4d13d1020cbcf7abf472"}}}}