{"action":"created","comment":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/68145734","id":68145734,"diff_hunk":"@@ -19,18 +19,48 @@\n //! `InstaSet` and `IndexSet` below.\n \n use std::fmt;\n+use std::net;\n use std::ops::Deref;\n+use std::sync::Arc;\n+use std::time::Duration;\n+use std::thread;\n \n use protobuf::{Message, parse_from_bytes};\n use protocol::{InstaId, Persistable};\n use r2d2;\n-use r2d2_redis;\n-use redis::{self, Commands, PipelineCommands};\n+use r2d2_redis::{self, RedisConnectionManager};\n+use redis::{self, Commands, IntoConnectionInfo, PipelineCommands};\n \n+use config::DataStoreCfg;\n use error::{Error, Result};\n \n pub type ConnectionPool = r2d2::Pool<r2d2_redis::RedisConnectionManager>;\n \n+pub trait Pool: Sized {\n+    type Config: DataStoreCfg;","path":"components/builder-dbcache/src/data_store.rs","position":24,"original_position":24,"commit_id":"de10389de34ce67234a4d6b6aced71f86e9a57a6","original_commit_id":"de10389de34ce67234a4d6b6aced71f86e9a57a6","user":{"login":"adamhjk","id":4304,"avatar_url":"https://avatars.githubusercontent.com/u/4304?v=3","gravatar_id":"","url":"https://api.github.com/users/adamhjk","html_url":"https://github.com/adamhjk","followers_url":"https://api.github.com/users/adamhjk/followers","following_url":"https://api.github.com/users/adamhjk/following{/other_user}","gists_url":"https://api.github.com/users/adamhjk/gists{/gist_id}","starred_url":"https://api.github.com/users/adamhjk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamhjk/subscriptions","organizations_url":"https://api.github.com/users/adamhjk/orgs","repos_url":"https://api.github.com/users/adamhjk/repos","events_url":"https://api.github.com/users/adamhjk/events{/privacy}","received_events_url":"https://api.github.com/users/adamhjk/received_events","type":"User","site_admin":false},"body":"Unlike my spelling and grammar game, which is trending down. :)","created_at":"2016-06-22T22:17:08Z","updated_at":"2016-06-22T22:17:08Z","html_url":"https://github.com/habitat-sh/habitat/pull/944#discussion_r68145734","pull_request_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/944","_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments/68145734"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/944#discussion_r68145734"},"pull_request":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/944"}}},"pull_request":{"url":"https://api.github.com/repos/habitat-sh/habitat/pulls/944","id":74681152,"html_url":"https://github.com/habitat-sh/habitat/pull/944","diff_url":"https://github.com/habitat-sh/habitat/pull/944.diff","patch_url":"https://github.com/habitat-sh/habitat/pull/944.patch","issue_url":"https://api.github.com/repos/habitat-sh/habitat/issues/944","number":944,"state":"open","locked":false,"title":"Move DataStore ownership from dispatcher/worker to server","user":{"login":"reset","id":54036,"avatar_url":"https://avatars.githubusercontent.com/u/54036?v=3","gravatar_id":"","url":"https://api.github.com/users/reset","html_url":"https://github.com/reset","followers_url":"https://api.github.com/users/reset/followers","following_url":"https://api.github.com/users/reset/following{/other_user}","gists_url":"https://api.github.com/users/reset/gists{/gist_id}","starred_url":"https://api.github.com/users/reset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reset/subscriptions","organizations_url":"https://api.github.com/users/reset/orgs","repos_url":"https://api.github.com/users/reset/repos","events_url":"https://api.github.com/users/reset/events{/privacy}","received_events_url":"https://api.github.com/users/reset/received_events","type":"User","site_admin":false},"body":"DataStore connections are no longer allocated per worker and on the stack\r\n\r\n* Allocate the connection manager to the heap\r\n* Pass initial state to dispatcher\r\n  * State is shared and must implement clone. This state is cloned for each worker ensuring that\r\n    new workers are always started with the latest configuration\r\n  * This contains a reference to the heap allocated DataStore for builder services\r\n  * Initial state is converted into actual state and passed by reference from main loop on each\r\n    call to dispatch a message\r\n* Add DataStoreCfg trait for reading datastore connection info from server config file\r\n  * DataStore specific options can now be tweaked via exposing functions on this trait. See\r\n    the included functions for details\r\n* Re-arrange Dispatcher components in net crate\r\n  * Add `hab_net::dispatcher::prelude` module which allows developers to easily glob the common\r\n    dispatcher components into their module\r\n\r\nSigned-off-by: Jamie Winsor <jamie@vialstudios.com>\r\n\r\n![gif-keyboard-15982393327634948593](https://cloud.githubusercontent.com/assets/54036/16245367/5a995fb4-37b5-11e6-850d-e40d45f0c98c.gif)\r\n","created_at":"2016-06-21T20:37:56Z","updated_at":"2016-06-22T22:17:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b8add0d58c793b1bdce5268370c039aaea303149","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/944/commits","review_comments_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/944/comments","review_comment_url":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/issues/944/comments","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/de10389de34ce67234a4d6b6aced71f86e9a57a6","head":{"label":"habitat-sh:database-pooling","ref":"database-pooling","sha":"de10389de34ce67234a4d6b6aced71f86e9a57a6","user":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars.githubusercontent.com/u/18171698?v=3","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"name":"habitat","full_name":"habitat-sh/habitat","owner":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars.githubusercontent.com/u/18171698?v=3","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2016-06-22T19:45:07Z","pushed_at":"2016-06-22T22:10:15Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":35405,"stargazers_count":671,"watchers_count":671,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":44,"forks":55,"open_issues":44,"watchers":671,"default_branch":"master"}},"base":{"label":"habitat-sh:master","ref":"master","sha":"2cb40e896c438af95cc783fbb86d59d44fa366f8","user":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars.githubusercontent.com/u/18171698?v=3","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"repo":{"id":36098429,"name":"habitat","full_name":"habitat-sh/habitat","owner":{"login":"habitat-sh","id":18171698,"avatar_url":"https://avatars.githubusercontent.com/u/18171698?v=3","gravatar_id":"","url":"https://api.github.com/users/habitat-sh","html_url":"https://github.com/habitat-sh","followers_url":"https://api.github.com/users/habitat-sh/followers","following_url":"https://api.github.com/users/habitat-sh/following{/other_user}","gists_url":"https://api.github.com/users/habitat-sh/gists{/gist_id}","starred_url":"https://api.github.com/users/habitat-sh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/habitat-sh/subscriptions","organizations_url":"https://api.github.com/users/habitat-sh/orgs","repos_url":"https://api.github.com/users/habitat-sh/repos","events_url":"https://api.github.com/users/habitat-sh/events{/privacy}","received_events_url":"https://api.github.com/users/habitat-sh/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/habitat-sh/habitat","description":"Modern applications with built-in automation","fork":false,"url":"https://api.github.com/repos/habitat-sh/habitat","forks_url":"https://api.github.com/repos/habitat-sh/habitat/forks","keys_url":"https://api.github.com/repos/habitat-sh/habitat/keys{/key_id}","collaborators_url":"https://api.github.com/repos/habitat-sh/habitat/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/habitat-sh/habitat/teams","hooks_url":"https://api.github.com/repos/habitat-sh/habitat/hooks","issue_events_url":"https://api.github.com/repos/habitat-sh/habitat/issues/events{/number}","events_url":"https://api.github.com/repos/habitat-sh/habitat/events","assignees_url":"https://api.github.com/repos/habitat-sh/habitat/assignees{/user}","branches_url":"https://api.github.com/repos/habitat-sh/habitat/branches{/branch}","tags_url":"https://api.github.com/repos/habitat-sh/habitat/tags","blobs_url":"https://api.github.com/repos/habitat-sh/habitat/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/habitat-sh/habitat/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/habitat-sh/habitat/git/refs{/sha}","trees_url":"https://api.github.com/repos/habitat-sh/habitat/git/trees{/sha}","statuses_url":"https://api.github.com/repos/habitat-sh/habitat/statuses/{sha}","languages_url":"https://api.github.com/repos/habitat-sh/habitat/languages","stargazers_url":"https://api.github.com/repos/habitat-sh/habitat/stargazers","contributors_url":"https://api.github.com/repos/habitat-sh/habitat/contributors","subscribers_url":"https://api.github.com/repos/habitat-sh/habitat/subscribers","subscription_url":"https://api.github.com/repos/habitat-sh/habitat/subscription","commits_url":"https://api.github.com/repos/habitat-sh/habitat/commits{/sha}","git_commits_url":"https://api.github.com/repos/habitat-sh/habitat/git/commits{/sha}","comments_url":"https://api.github.com/repos/habitat-sh/habitat/comments{/number}","issue_comment_url":"https://api.github.com/repos/habitat-sh/habitat/issues/comments{/number}","contents_url":"https://api.github.com/repos/habitat-sh/habitat/contents/{+path}","compare_url":"https://api.github.com/repos/habitat-sh/habitat/compare/{base}...{head}","merges_url":"https://api.github.com/repos/habitat-sh/habitat/merges","archive_url":"https://api.github.com/repos/habitat-sh/habitat/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/habitat-sh/habitat/downloads","issues_url":"https://api.github.com/repos/habitat-sh/habitat/issues{/number}","pulls_url":"https://api.github.com/repos/habitat-sh/habitat/pulls{/number}","milestones_url":"https://api.github.com/repos/habitat-sh/habitat/milestones{/number}","notifications_url":"https://api.github.com/repos/habitat-sh/habitat/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/habitat-sh/habitat/labels{/name}","releases_url":"https://api.github.com/repos/habitat-sh/habitat/releases{/id}","deployments_url":"https://api.github.com/repos/habitat-sh/habitat/deployments","created_at":"2015-05-22T22:47:14Z","updated_at":"2016-06-22T19:45:07Z","pushed_at":"2016-06-22T22:10:15Z","git_url":"git://github.com/habitat-sh/habitat.git","ssh_url":"git@github.com:habitat-sh/habitat.git","clone_url":"https://github.com/habitat-sh/habitat.git","svn_url":"https://github.com/habitat-sh/habitat","homepage":"https://www.habitat.sh","size":35405,"stargazers_count":671,"watchers_count":671,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":44,"forks":55,"open_issues":44,"watchers":671,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/944"},"html":{"href":"https://github.com/habitat-sh/habitat/pull/944"},"issue":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/944"},"comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/issues/944/comments"},"review_comments":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/944/comments"},"review_comment":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/habitat-sh/habitat/pulls/944/commits"},"statuses":{"href":"https://api.github.com/repos/habitat-sh/habitat/statuses/de10389de34ce67234a4d6b6aced71f86e9a57a6"}}}}
{"actor":{"display_login":"adamhjk"}}