{"action":"created","comment":{"url":"https://api.github.com/repos/Clever/thrift-pool/pulls/comments/24223541","id":24223541,"diff_hunk":"@@ -1,2 +1,52 @@\n-# thrift-pool\n+# Thrift Pool\n+\n A module that wraps thrift interfaces in connection pooling logic to make them more resilient.\n+\n+The [node thrift code](https://www.npmjs.com/package/thrift) exposes a `service` and `types` file.\n+The node thrift client also exposes interfaces to create connections to the thrift server.\n+There is no way to use the node thrift library to do connectionn pooling or to create new connections if existing connections fail.\n+\n+This library takes in a thrift `service` and wraps the methods with connection pooling logic (based on [node-pool](https://github.com/coopernurse/node-pool)).\n+\n+\n+## Installation\n+\n+```\n+npm install thrift-pool\n+```\n+\n+## Usage\n+```javascript\n+var thrift = require('thrift'),\n+  Service = require('./gen-nodejs/Service'),\n+  Types = require('./gen-nodejs/types'),\n+  thriftPool = require('thrift-pool');\n+\n+var thrift_client = thriftPool(thrift, Service, {host: \"localhost\", port: 9090});\n+\n+/*\n+ * thrift_client is now an initialized thrift client that uses connection pooling behind the scenes\n+ * thrift_client.method(function(err, returned_data){console.log(err, returned_data)});\n+ */\n+\n+```\n+\n+## Supported options\n+\n+- `host` - **Required** - The host of the thrift server to connect to\n+- `port` - **Required** - The port of the thrift server to connect to\n+- `timeout` - Default: `250` - Timeout in ms for connection creation\n+- `max_connections` - Default: `20` - Max number of connections to keep open\n+- `min_connections` - Default: `2` - Min number of connections to keep open\n+- `idle_timeout`: Default: `2000` - Time in ms to wait until closing idle connections","path":"README.md","position":42,"original_position":42,"commit_id":"6fdd58e25d3a4f9d1903162ae00a1756e7c66d50","original_commit_id":"6fdd58e25d3a4f9d1903162ae00a1756e7c66d50","user":{"login":"ipam73","id":4316215,"avatar_url":"https://avatars.githubusercontent.com/u/4316215?v=3","gravatar_id":"","url":"https://api.github.com/users/ipam73","html_url":"https://github.com/ipam73","followers_url":"https://api.github.com/users/ipam73/followers","following_url":"https://api.github.com/users/ipam73/following{/other_user}","gists_url":"https://api.github.com/users/ipam73/gists{/gist_id}","starred_url":"https://api.github.com/users/ipam73/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipam73/subscriptions","organizations_url":"https://api.github.com/users/ipam73/orgs","repos_url":"https://api.github.com/users/ipam73/repos","events_url":"https://api.github.com/users/ipam73/events{/privacy}","received_events_url":"https://api.github.com/users/ipam73/received_events","type":"User","site_admin":false},"body":"[node-pool](https://github.com/coopernurse/node-pool) uses 30,000, we could use same default:\r\n\r\n `idleTimeoutMillis : max milliseconds a resource can go unused before it should be destroyed\r\n                     (default 30000)`\r\n","created_at":"2015-02-06T05:35:34Z","updated_at":"2015-02-06T05:35:34Z","html_url":"https://github.com/Clever/thrift-pool/pull/1#discussion_r24223541","pull_request_url":"https://api.github.com/repos/Clever/thrift-pool/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/comments/24223541"},"html":{"href":"https://github.com/Clever/thrift-pool/pull/1#discussion_r24223541"},"pull_request":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/Clever/thrift-pool/pulls/1","id":28141920,"html_url":"https://github.com/Clever/thrift-pool/pull/1","diff_url":"https://github.com/Clever/thrift-pool/pull/1.diff","patch_url":"https://github.com/Clever/thrift-pool/pull/1.patch","issue_url":"https://api.github.com/repos/Clever/thrift-pool/issues/1","number":1,"state":"open","locked":false,"title":"Birthday","user":{"login":"templaedhel","id":696340,"avatar_url":"https://avatars.githubusercontent.com/u/696340?v=3","gravatar_id":"","url":"https://api.github.com/users/templaedhel","html_url":"https://github.com/templaedhel","followers_url":"https://api.github.com/users/templaedhel/followers","following_url":"https://api.github.com/users/templaedhel/following{/other_user}","gists_url":"https://api.github.com/users/templaedhel/gists{/gist_id}","starred_url":"https://api.github.com/users/templaedhel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/templaedhel/subscriptions","organizations_url":"https://api.github.com/users/templaedhel/orgs","repos_url":"https://api.github.com/users/templaedhel/repos","events_url":"https://api.github.com/users/templaedhel/events{/privacy}","received_events_url":"https://api.github.com/users/templaedhel/received_events","type":"User","site_admin":false},"body":"Adding the initial thrift-pool files. ","created_at":"2015-01-27T20:32:28Z","updated_at":"2015-02-06T05:35:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"806cae0889563559b0e1cb89bb7e6a0b57ea7355","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Clever/thrift-pool/pulls/1/commits","review_comments_url":"https://api.github.com/repos/Clever/thrift-pool/pulls/1/comments","review_comment_url":"https://api.github.com/repos/Clever/thrift-pool/pulls/comments/{number}","comments_url":"https://api.github.com/repos/Clever/thrift-pool/issues/1/comments","statuses_url":"https://api.github.com/repos/Clever/thrift-pool/statuses/6fdd58e25d3a4f9d1903162ae00a1756e7c66d50","head":{"label":"Clever:birthday","ref":"birthday","sha":"6fdd58e25d3a4f9d1903162ae00a1756e7c66d50","user":{"login":"Clever","id":1885509,"avatar_url":"https://avatars.githubusercontent.com/u/1885509?v=3","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"repo":{"id":29933431,"name":"thrift-pool","full_name":"Clever/thrift-pool","owner":{"login":"Clever","id":1885509,"avatar_url":"https://avatars.githubusercontent.com/u/1885509?v=3","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Clever/thrift-pool","description":"A module that wraps thrift interfaces in connection pooling logic to make them more resilient.","fork":false,"url":"https://api.github.com/repos/Clever/thrift-pool","forks_url":"https://api.github.com/repos/Clever/thrift-pool/forks","keys_url":"https://api.github.com/repos/Clever/thrift-pool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Clever/thrift-pool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Clever/thrift-pool/teams","hooks_url":"https://api.github.com/repos/Clever/thrift-pool/hooks","issue_events_url":"https://api.github.com/repos/Clever/thrift-pool/issues/events{/number}","events_url":"https://api.github.com/repos/Clever/thrift-pool/events","assignees_url":"https://api.github.com/repos/Clever/thrift-pool/assignees{/user}","branches_url":"https://api.github.com/repos/Clever/thrift-pool/branches{/branch}","tags_url":"https://api.github.com/repos/Clever/thrift-pool/tags","blobs_url":"https://api.github.com/repos/Clever/thrift-pool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Clever/thrift-pool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Clever/thrift-pool/git/refs{/sha}","trees_url":"https://api.github.com/repos/Clever/thrift-pool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Clever/thrift-pool/statuses/{sha}","languages_url":"https://api.github.com/repos/Clever/thrift-pool/languages","stargazers_url":"https://api.github.com/repos/Clever/thrift-pool/stargazers","contributors_url":"https://api.github.com/repos/Clever/thrift-pool/contributors","subscribers_url":"https://api.github.com/repos/Clever/thrift-pool/subscribers","subscription_url":"https://api.github.com/repos/Clever/thrift-pool/subscription","commits_url":"https://api.github.com/repos/Clever/thrift-pool/commits{/sha}","git_commits_url":"https://api.github.com/repos/Clever/thrift-pool/git/commits{/sha}","comments_url":"https://api.github.com/repos/Clever/thrift-pool/comments{/number}","issue_comment_url":"https://api.github.com/repos/Clever/thrift-pool/issues/comments/{number}","contents_url":"https://api.github.com/repos/Clever/thrift-pool/contents/{+path}","compare_url":"https://api.github.com/repos/Clever/thrift-pool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Clever/thrift-pool/merges","archive_url":"https://api.github.com/repos/Clever/thrift-pool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Clever/thrift-pool/downloads","issues_url":"https://api.github.com/repos/Clever/thrift-pool/issues{/number}","pulls_url":"https://api.github.com/repos/Clever/thrift-pool/pulls{/number}","milestones_url":"https://api.github.com/repos/Clever/thrift-pool/milestones{/number}","notifications_url":"https://api.github.com/repos/Clever/thrift-pool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Clever/thrift-pool/labels{/name}","releases_url":"https://api.github.com/repos/Clever/thrift-pool/releases{/id}","created_at":"2015-01-27T20:27:54Z","updated_at":"2015-01-27T20:27:54Z","pushed_at":"2015-02-06T00:29:58Z","git_url":"git://github.com/Clever/thrift-pool.git","ssh_url":"git@github.com:Clever/thrift-pool.git","clone_url":"https://github.com/Clever/thrift-pool.git","svn_url":"https://github.com/Clever/thrift-pool","homepage":null,"size":168,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Clever:master","ref":"master","sha":"c82bc0a4bda2e3277851c402b082ef6517e5fa52","user":{"login":"Clever","id":1885509,"avatar_url":"https://avatars.githubusercontent.com/u/1885509?v=3","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"repo":{"id":29933431,"name":"thrift-pool","full_name":"Clever/thrift-pool","owner":{"login":"Clever","id":1885509,"avatar_url":"https://avatars.githubusercontent.com/u/1885509?v=3","gravatar_id":"","url":"https://api.github.com/users/Clever","html_url":"https://github.com/Clever","followers_url":"https://api.github.com/users/Clever/followers","following_url":"https://api.github.com/users/Clever/following{/other_user}","gists_url":"https://api.github.com/users/Clever/gists{/gist_id}","starred_url":"https://api.github.com/users/Clever/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Clever/subscriptions","organizations_url":"https://api.github.com/users/Clever/orgs","repos_url":"https://api.github.com/users/Clever/repos","events_url":"https://api.github.com/users/Clever/events{/privacy}","received_events_url":"https://api.github.com/users/Clever/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Clever/thrift-pool","description":"A module that wraps thrift interfaces in connection pooling logic to make them more resilient.","fork":false,"url":"https://api.github.com/repos/Clever/thrift-pool","forks_url":"https://api.github.com/repos/Clever/thrift-pool/forks","keys_url":"https://api.github.com/repos/Clever/thrift-pool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Clever/thrift-pool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Clever/thrift-pool/teams","hooks_url":"https://api.github.com/repos/Clever/thrift-pool/hooks","issue_events_url":"https://api.github.com/repos/Clever/thrift-pool/issues/events{/number}","events_url":"https://api.github.com/repos/Clever/thrift-pool/events","assignees_url":"https://api.github.com/repos/Clever/thrift-pool/assignees{/user}","branches_url":"https://api.github.com/repos/Clever/thrift-pool/branches{/branch}","tags_url":"https://api.github.com/repos/Clever/thrift-pool/tags","blobs_url":"https://api.github.com/repos/Clever/thrift-pool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Clever/thrift-pool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Clever/thrift-pool/git/refs{/sha}","trees_url":"https://api.github.com/repos/Clever/thrift-pool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Clever/thrift-pool/statuses/{sha}","languages_url":"https://api.github.com/repos/Clever/thrift-pool/languages","stargazers_url":"https://api.github.com/repos/Clever/thrift-pool/stargazers","contributors_url":"https://api.github.com/repos/Clever/thrift-pool/contributors","subscribers_url":"https://api.github.com/repos/Clever/thrift-pool/subscribers","subscription_url":"https://api.github.com/repos/Clever/thrift-pool/subscription","commits_url":"https://api.github.com/repos/Clever/thrift-pool/commits{/sha}","git_commits_url":"https://api.github.com/repos/Clever/thrift-pool/git/commits{/sha}","comments_url":"https://api.github.com/repos/Clever/thrift-pool/comments{/number}","issue_comment_url":"https://api.github.com/repos/Clever/thrift-pool/issues/comments/{number}","contents_url":"https://api.github.com/repos/Clever/thrift-pool/contents/{+path}","compare_url":"https://api.github.com/repos/Clever/thrift-pool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Clever/thrift-pool/merges","archive_url":"https://api.github.com/repos/Clever/thrift-pool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Clever/thrift-pool/downloads","issues_url":"https://api.github.com/repos/Clever/thrift-pool/issues{/number}","pulls_url":"https://api.github.com/repos/Clever/thrift-pool/pulls{/number}","milestones_url":"https://api.github.com/repos/Clever/thrift-pool/milestones{/number}","notifications_url":"https://api.github.com/repos/Clever/thrift-pool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Clever/thrift-pool/labels{/name}","releases_url":"https://api.github.com/repos/Clever/thrift-pool/releases{/id}","created_at":"2015-01-27T20:27:54Z","updated_at":"2015-01-27T20:27:54Z","pushed_at":"2015-02-06T00:29:58Z","git_url":"git://github.com/Clever/thrift-pool.git","ssh_url":"git@github.com:Clever/thrift-pool.git","clone_url":"https://github.com/Clever/thrift-pool.git","svn_url":"https://github.com/Clever/thrift-pool","homepage":null,"size":168,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/1"},"html":{"href":"https://github.com/Clever/thrift-pool/pull/1"},"issue":{"href":"https://api.github.com/repos/Clever/thrift-pool/issues/1"},"comments":{"href":"https://api.github.com/repos/Clever/thrift-pool/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/Clever/thrift-pool/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/Clever/thrift-pool/statuses/6fdd58e25d3a4f9d1903162ae00a1756e7c66d50"}}}}