{"action":"opened","number":46,"pull_request":{"url":"https://api.github.com/repos/redding/dat-tcp/pulls/46","id":51290113,"html_url":"https://github.com/redding/dat-tcp/pull/46","diff_url":"https://github.com/redding/dat-tcp/pull/46.diff","patch_url":"https://github.com/redding/dat-tcp/pull/46.patch","issue_url":"https://api.github.com/repos/redding/dat-tcp/issues/46","number":46,"state":"open","locked":false,"title":"Update to use the new dat-worker-pool","user":{"login":"jcredding","id":85966,"avatar_url":"https://avatars.githubusercontent.com/u/85966?v=3","gravatar_id":"","url":"https://api.github.com/users/jcredding","html_url":"https://github.com/jcredding","followers_url":"https://api.github.com/users/jcredding/followers","following_url":"https://api.github.com/users/jcredding/following{/other_user}","gists_url":"https://api.github.com/users/jcredding/gists{/gist_id}","starred_url":"https://api.github.com/users/jcredding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcredding/subscriptions","organizations_url":"https://api.github.com/users/jcredding/orgs","repos_url":"https://api.github.com/users/jcredding/repos","events_url":"https://api.github.com/users/jcredding/events{/privacy}","received_events_url":"https://api.github.com/users/jcredding/received_events","type":"User","site_admin":false},"body":"This updates dat-tcp to use the new dat-worker-pool.\r\ndat-worker-pool has interface has changed but functionally it works\r\nthe same as it previously did.\r\n\r\nWhen a server is initialized it now takes a worker class and a\r\nset of options instead of just taking options. This is because\r\ndat-worker-pool now requires a worker class when its initialized.\r\nA block is no longer part of the server or dat-worker-pools\r\ninterface. The logic for processing a work item (a client socket\r\nfor dat-tcp) is now part of the worker class that is passed in.\r\nThe server also no longer takes worker callbacks, these should be\r\nadded to the worker class thats passed in.\r\n\r\nThe server now also builds a worker pool when its initialized\r\ninstead of waiting till its started. This was previously made\r\npossible when dat-worker-pool was changed to not start\r\nautomatically but dat-tcp didn't take advantage of it till now.\r\nThis avoids some conditionals and having to set/unset the worker\r\npool ivar as the server is started/stopped.\r\n\r\nAs part of this change, dat-tcp now also provides a `Worker` mixin\r\nwhich for now only brings in dat-worker-pools `Worker` mixin. It\r\nalso requires the worker class that is passed to the server use\r\nthis mixin.\r\n\r\nThis also includes a number of small changes related to using the\r\nnew dat-worker-pool and the server interface changing:\r\n\r\n* The server no longer takes a min and max number of workers\r\n  because dat-worker-pool no longer supports a min or max. It now\r\n  defaults to 2 workers (its previous min value).\r\n* Renamed the passed in client file descriptors. This confused me\r\n  because the local variable and the method were the same name.\r\n* Removed the thread status from the inspect. I'd rather not expose\r\n  this level of detail about how the server works.\r\n* Changed the work loop organization to try and make it more\r\n  readable. I didn't find it very approachable when I was trying to\r\n  understand its logic.\r\n* Updated styles and conventions to our latest standards\r\n  throughout.\r\n\r\n@kellyredding - Ready for review.","created_at":"2015-11-19T22:20:51Z","updated_at":"2015-11-19T22:20:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/redding/dat-tcp/pulls/46/commits","review_comments_url":"https://api.github.com/repos/redding/dat-tcp/pulls/46/comments","review_comment_url":"https://api.github.com/repos/redding/dat-tcp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redding/dat-tcp/issues/46/comments","statuses_url":"https://api.github.com/repos/redding/dat-tcp/statuses/2dc34bb0424f5b862a84f5060bb81302552b7946","head":{"label":"redding:jcr-new-dwp","ref":"jcr-new-dwp","sha":"2dc34bb0424f5b862a84f5060bb81302552b7946","user":{"login":"redding","id":2427810,"avatar_url":"https://avatars.githubusercontent.com/u/2427810?v=3","gravatar_id":"","url":"https://api.github.com/users/redding","html_url":"https://github.com/redding","followers_url":"https://api.github.com/users/redding/followers","following_url":"https://api.github.com/users/redding/following{/other_user}","gists_url":"https://api.github.com/users/redding/gists{/gist_id}","starred_url":"https://api.github.com/users/redding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redding/subscriptions","organizations_url":"https://api.github.com/users/redding/orgs","repos_url":"https://api.github.com/users/redding/repos","events_url":"https://api.github.com/users/redding/events{/privacy}","received_events_url":"https://api.github.com/users/redding/received_events","type":"Organization","site_admin":false},"repo":{"id":6693344,"name":"dat-tcp","full_name":"redding/dat-tcp","owner":{"login":"redding","id":2427810,"avatar_url":"https://avatars.githubusercontent.com/u/2427810?v=3","gravatar_id":"","url":"https://api.github.com/users/redding","html_url":"https://github.com/redding","followers_url":"https://api.github.com/users/redding/followers","following_url":"https://api.github.com/users/redding/following{/other_user}","gists_url":"https://api.github.com/users/redding/gists{/gist_id}","starred_url":"https://api.github.com/users/redding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redding/subscriptions","organizations_url":"https://api.github.com/users/redding/orgs","repos_url":"https://api.github.com/users/redding/repos","events_url":"https://api.github.com/users/redding/events{/privacy}","received_events_url":"https://api.github.com/users/redding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redding/dat-tcp","description":"Threaded TCP server","fork":false,"url":"https://api.github.com/repos/redding/dat-tcp","forks_url":"https://api.github.com/repos/redding/dat-tcp/forks","keys_url":"https://api.github.com/repos/redding/dat-tcp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redding/dat-tcp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redding/dat-tcp/teams","hooks_url":"https://api.github.com/repos/redding/dat-tcp/hooks","issue_events_url":"https://api.github.com/repos/redding/dat-tcp/issues/events{/number}","events_url":"https://api.github.com/repos/redding/dat-tcp/events","assignees_url":"https://api.github.com/repos/redding/dat-tcp/assignees{/user}","branches_url":"https://api.github.com/repos/redding/dat-tcp/branches{/branch}","tags_url":"https://api.github.com/repos/redding/dat-tcp/tags","blobs_url":"https://api.github.com/repos/redding/dat-tcp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redding/dat-tcp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redding/dat-tcp/git/refs{/sha}","trees_url":"https://api.github.com/repos/redding/dat-tcp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redding/dat-tcp/statuses/{sha}","languages_url":"https://api.github.com/repos/redding/dat-tcp/languages","stargazers_url":"https://api.github.com/repos/redding/dat-tcp/stargazers","contributors_url":"https://api.github.com/repos/redding/dat-tcp/contributors","subscribers_url":"https://api.github.com/repos/redding/dat-tcp/subscribers","subscription_url":"https://api.github.com/repos/redding/dat-tcp/subscription","commits_url":"https://api.github.com/repos/redding/dat-tcp/commits{/sha}","git_commits_url":"https://api.github.com/repos/redding/dat-tcp/git/commits{/sha}","comments_url":"https://api.github.com/repos/redding/dat-tcp/comments{/number}","issue_comment_url":"https://api.github.com/repos/redding/dat-tcp/issues/comments{/number}","contents_url":"https://api.github.com/repos/redding/dat-tcp/contents/{+path}","compare_url":"https://api.github.com/repos/redding/dat-tcp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redding/dat-tcp/merges","archive_url":"https://api.github.com/repos/redding/dat-tcp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redding/dat-tcp/downloads","issues_url":"https://api.github.com/repos/redding/dat-tcp/issues{/number}","pulls_url":"https://api.github.com/repos/redding/dat-tcp/pulls{/number}","milestones_url":"https://api.github.com/repos/redding/dat-tcp/milestones{/number}","notifications_url":"https://api.github.com/repos/redding/dat-tcp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redding/dat-tcp/labels{/name}","releases_url":"https://api.github.com/repos/redding/dat-tcp/releases{/id}","created_at":"2012-11-14T19:21:06Z","updated_at":"2015-01-30T17:10:50Z","pushed_at":"2015-11-19T22:20:08Z","git_url":"git://github.com/redding/dat-tcp.git","ssh_url":"git@github.com:redding/dat-tcp.git","clone_url":"https://github.com/redding/dat-tcp.git","svn_url":"https://github.com/redding/dat-tcp","homepage":null,"size":128,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"redding:feature-new-dwp","ref":"feature-new-dwp","sha":"cd3114017f0488af806b64c463020eee1cdb2c4a","user":{"login":"redding","id":2427810,"avatar_url":"https://avatars.githubusercontent.com/u/2427810?v=3","gravatar_id":"","url":"https://api.github.com/users/redding","html_url":"https://github.com/redding","followers_url":"https://api.github.com/users/redding/followers","following_url":"https://api.github.com/users/redding/following{/other_user}","gists_url":"https://api.github.com/users/redding/gists{/gist_id}","starred_url":"https://api.github.com/users/redding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redding/subscriptions","organizations_url":"https://api.github.com/users/redding/orgs","repos_url":"https://api.github.com/users/redding/repos","events_url":"https://api.github.com/users/redding/events{/privacy}","received_events_url":"https://api.github.com/users/redding/received_events","type":"Organization","site_admin":false},"repo":{"id":6693344,"name":"dat-tcp","full_name":"redding/dat-tcp","owner":{"login":"redding","id":2427810,"avatar_url":"https://avatars.githubusercontent.com/u/2427810?v=3","gravatar_id":"","url":"https://api.github.com/users/redding","html_url":"https://github.com/redding","followers_url":"https://api.github.com/users/redding/followers","following_url":"https://api.github.com/users/redding/following{/other_user}","gists_url":"https://api.github.com/users/redding/gists{/gist_id}","starred_url":"https://api.github.com/users/redding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redding/subscriptions","organizations_url":"https://api.github.com/users/redding/orgs","repos_url":"https://api.github.com/users/redding/repos","events_url":"https://api.github.com/users/redding/events{/privacy}","received_events_url":"https://api.github.com/users/redding/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/redding/dat-tcp","description":"Threaded TCP server","fork":false,"url":"https://api.github.com/repos/redding/dat-tcp","forks_url":"https://api.github.com/repos/redding/dat-tcp/forks","keys_url":"https://api.github.com/repos/redding/dat-tcp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redding/dat-tcp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redding/dat-tcp/teams","hooks_url":"https://api.github.com/repos/redding/dat-tcp/hooks","issue_events_url":"https://api.github.com/repos/redding/dat-tcp/issues/events{/number}","events_url":"https://api.github.com/repos/redding/dat-tcp/events","assignees_url":"https://api.github.com/repos/redding/dat-tcp/assignees{/user}","branches_url":"https://api.github.com/repos/redding/dat-tcp/branches{/branch}","tags_url":"https://api.github.com/repos/redding/dat-tcp/tags","blobs_url":"https://api.github.com/repos/redding/dat-tcp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redding/dat-tcp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redding/dat-tcp/git/refs{/sha}","trees_url":"https://api.github.com/repos/redding/dat-tcp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redding/dat-tcp/statuses/{sha}","languages_url":"https://api.github.com/repos/redding/dat-tcp/languages","stargazers_url":"https://api.github.com/repos/redding/dat-tcp/stargazers","contributors_url":"https://api.github.com/repos/redding/dat-tcp/contributors","subscribers_url":"https://api.github.com/repos/redding/dat-tcp/subscribers","subscription_url":"https://api.github.com/repos/redding/dat-tcp/subscription","commits_url":"https://api.github.com/repos/redding/dat-tcp/commits{/sha}","git_commits_url":"https://api.github.com/repos/redding/dat-tcp/git/commits{/sha}","comments_url":"https://api.github.com/repos/redding/dat-tcp/comments{/number}","issue_comment_url":"https://api.github.com/repos/redding/dat-tcp/issues/comments{/number}","contents_url":"https://api.github.com/repos/redding/dat-tcp/contents/{+path}","compare_url":"https://api.github.com/repos/redding/dat-tcp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redding/dat-tcp/merges","archive_url":"https://api.github.com/repos/redding/dat-tcp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redding/dat-tcp/downloads","issues_url":"https://api.github.com/repos/redding/dat-tcp/issues{/number}","pulls_url":"https://api.github.com/repos/redding/dat-tcp/pulls{/number}","milestones_url":"https://api.github.com/repos/redding/dat-tcp/milestones{/number}","notifications_url":"https://api.github.com/repos/redding/dat-tcp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redding/dat-tcp/labels{/name}","releases_url":"https://api.github.com/repos/redding/dat-tcp/releases{/id}","created_at":"2012-11-14T19:21:06Z","updated_at":"2015-01-30T17:10:50Z","pushed_at":"2015-11-19T22:20:08Z","git_url":"git://github.com/redding/dat-tcp.git","ssh_url":"git@github.com:redding/dat-tcp.git","clone_url":"https://github.com/redding/dat-tcp.git","svn_url":"https://github.com/redding/dat-tcp","homepage":null,"size":128,"stargazers_count":1,"watchers_count":1,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redding/dat-tcp/pulls/46"},"html":{"href":"https://github.com/redding/dat-tcp/pull/46"},"issue":{"href":"https://api.github.com/repos/redding/dat-tcp/issues/46"},"comments":{"href":"https://api.github.com/repos/redding/dat-tcp/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/redding/dat-tcp/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/redding/dat-tcp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redding/dat-tcp/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/redding/dat-tcp/statuses/2dc34bb0424f5b862a84f5060bb81302552b7946"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":227,"deletions":231,"changed_files":11}}