{"action":"created","comment":{"url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/comments/43573224","id":43573224,"diff_hunk":"@@ -13,11 +13,10 @@ class WorkerPoolSpy\n     attr_reader :before_work_callbacks, :after_work_callbacks\n     attr_accessor :worker_available\n \n-    def initialize(min = 0, max = 1, debug = false, &block)\n-      @min_workers  = min\n-      @max_workers  = max\n-      @debug        = debug\n-      @work_proc    = block\n+    def initialize(number_of_workers = 1, debug = false, &block)\n+      @number_of_workers = number_of_workers","path":"lib/dat-worker-pool/worker_pool_spy.rb","position":19,"original_position":19,"commit_id":"6a28715e0bd11b18579077d5471a9c0e655b01f6","original_commit_id":"6a28715e0bd11b18579077d5471a9c0e655b01f6","user":{"login":"kellyredding","id":82110,"avatar_url":"https://avatars.githubusercontent.com/u/82110?v=3","gravatar_id":"","url":"https://api.github.com/users/kellyredding","html_url":"https://github.com/kellyredding","followers_url":"https://api.github.com/users/kellyredding/followers","following_url":"https://api.github.com/users/kellyredding/following{/other_user}","gists_url":"https://api.github.com/users/kellyredding/gists{/gist_id}","starred_url":"https://api.github.com/users/kellyredding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellyredding/subscriptions","organizations_url":"https://api.github.com/users/kellyredding/orgs","repos_url":"https://api.github.com/users/kellyredding/repos","events_url":"https://api.github.com/users/kellyredding/events{/privacy}","received_events_url":"https://api.github.com/users/kellyredding/received_events","type":"User","site_admin":false},"body":"@jcredding same here.","created_at":"2015-10-31T16:05:20Z","updated_at":"2015-10-31T16:05:20Z","html_url":"https://github.com/redding/dat-worker-pool/pull/22#discussion_r43573224","pull_request_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22","_links":{"self":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/comments/43573224"},"html":{"href":"https://github.com/redding/dat-worker-pool/pull/22#discussion_r43573224"},"pull_request":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22"}}},"pull_request":{"url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22","id":49349526,"html_url":"https://github.com/redding/dat-worker-pool/pull/22","diff_url":"https://github.com/redding/dat-worker-pool/pull/22.diff","patch_url":"https://github.com/redding/dat-worker-pool/pull/22.patch","issue_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/22","number":22,"state":"open","locked":false,"title":"Remove min and max workers, always spawn a consistent number of workers","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 changes worker pools to alway spawn a set number of workers.\r\nThey no longer have a min and max setting. This simplifies the\r\nworker pools logic and is setup for allowing custom queue classes.\r\n\r\nPreviously, dat worker pool would allow specifying a min and max\r\nnumber of workers. When work was added it would see if a worker\r\nwas available to process it, and if not, spawn another worker if\r\nit hadn't reached the max. With allowing custom queue classes, this\r\noption no longer makes as much sense. For some custom queue classes\r\nthey won't define a `push` method because they will not have work\r\ndirectly pushed onto them. Instead they will get their work from\r\nredis or a socket. In this case, there is no logical place to\r\ntrigger spawning additional workers. If we left min and max number\r\nof workers in, you would have to know to always configure the min\r\nand max the same if you had a queue that couldn't take advantage\r\nof it. Rather than deal with this and the added confusion, its\r\nsimpler to remove the logic.\r\n\r\n@kellyredding - Ready for review.","created_at":"2015-10-31T13:37:00Z","updated_at":"2015-10-31T16:05:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"50ed0e506043358edc8794efbed40176bbbc5410","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22/commits","review_comments_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22/comments","review_comment_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls/comments{/number}","comments_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/22/comments","statuses_url":"https://api.github.com/repos/redding/dat-worker-pool/statuses/6a28715e0bd11b18579077d5471a9c0e655b01f6","head":{"label":"redding:jcr-remove-min-max-workers","ref":"jcr-remove-min-max-workers","sha":"6a28715e0bd11b18579077d5471a9c0e655b01f6","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":11273840,"name":"dat-worker-pool","full_name":"redding/dat-worker-pool","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-worker-pool","description":"A simple thread pool for processing generic 'work'","fork":false,"url":"https://api.github.com/repos/redding/dat-worker-pool","forks_url":"https://api.github.com/repos/redding/dat-worker-pool/forks","keys_url":"https://api.github.com/repos/redding/dat-worker-pool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redding/dat-worker-pool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redding/dat-worker-pool/teams","hooks_url":"https://api.github.com/repos/redding/dat-worker-pool/hooks","issue_events_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/events{/number}","events_url":"https://api.github.com/repos/redding/dat-worker-pool/events","assignees_url":"https://api.github.com/repos/redding/dat-worker-pool/assignees{/user}","branches_url":"https://api.github.com/repos/redding/dat-worker-pool/branches{/branch}","tags_url":"https://api.github.com/repos/redding/dat-worker-pool/tags","blobs_url":"https://api.github.com/repos/redding/dat-worker-pool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redding/dat-worker-pool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redding/dat-worker-pool/git/refs{/sha}","trees_url":"https://api.github.com/repos/redding/dat-worker-pool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redding/dat-worker-pool/statuses/{sha}","languages_url":"https://api.github.com/repos/redding/dat-worker-pool/languages","stargazers_url":"https://api.github.com/repos/redding/dat-worker-pool/stargazers","contributors_url":"https://api.github.com/repos/redding/dat-worker-pool/contributors","subscribers_url":"https://api.github.com/repos/redding/dat-worker-pool/subscribers","subscription_url":"https://api.github.com/repos/redding/dat-worker-pool/subscription","commits_url":"https://api.github.com/repos/redding/dat-worker-pool/commits{/sha}","git_commits_url":"https://api.github.com/repos/redding/dat-worker-pool/git/commits{/sha}","comments_url":"https://api.github.com/repos/redding/dat-worker-pool/comments{/number}","issue_comment_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/comments{/number}","contents_url":"https://api.github.com/repos/redding/dat-worker-pool/contents/{+path}","compare_url":"https://api.github.com/repos/redding/dat-worker-pool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redding/dat-worker-pool/merges","archive_url":"https://api.github.com/repos/redding/dat-worker-pool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redding/dat-worker-pool/downloads","issues_url":"https://api.github.com/repos/redding/dat-worker-pool/issues{/number}","pulls_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls{/number}","milestones_url":"https://api.github.com/repos/redding/dat-worker-pool/milestones{/number}","notifications_url":"https://api.github.com/repos/redding/dat-worker-pool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redding/dat-worker-pool/labels{/name}","releases_url":"https://api.github.com/repos/redding/dat-worker-pool/releases{/id}","created_at":"2013-07-09T05:32:00Z","updated_at":"2015-04-22T16:00:08Z","pushed_at":"2015-10-31T13:37:01Z","git_url":"git://github.com/redding/dat-worker-pool.git","ssh_url":"git@github.com:redding/dat-worker-pool.git","clone_url":"https://github.com/redding/dat-worker-pool.git","svn_url":"https://github.com/redding/dat-worker-pool","homepage":null,"size":492,"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":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"redding:master","ref":"master","sha":"04735f9c08b86028c61e54009a9053dec247ca62","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":11273840,"name":"dat-worker-pool","full_name":"redding/dat-worker-pool","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-worker-pool","description":"A simple thread pool for processing generic 'work'","fork":false,"url":"https://api.github.com/repos/redding/dat-worker-pool","forks_url":"https://api.github.com/repos/redding/dat-worker-pool/forks","keys_url":"https://api.github.com/repos/redding/dat-worker-pool/keys{/key_id}","collaborators_url":"https://api.github.com/repos/redding/dat-worker-pool/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/redding/dat-worker-pool/teams","hooks_url":"https://api.github.com/repos/redding/dat-worker-pool/hooks","issue_events_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/events{/number}","events_url":"https://api.github.com/repos/redding/dat-worker-pool/events","assignees_url":"https://api.github.com/repos/redding/dat-worker-pool/assignees{/user}","branches_url":"https://api.github.com/repos/redding/dat-worker-pool/branches{/branch}","tags_url":"https://api.github.com/repos/redding/dat-worker-pool/tags","blobs_url":"https://api.github.com/repos/redding/dat-worker-pool/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/redding/dat-worker-pool/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/redding/dat-worker-pool/git/refs{/sha}","trees_url":"https://api.github.com/repos/redding/dat-worker-pool/git/trees{/sha}","statuses_url":"https://api.github.com/repos/redding/dat-worker-pool/statuses/{sha}","languages_url":"https://api.github.com/repos/redding/dat-worker-pool/languages","stargazers_url":"https://api.github.com/repos/redding/dat-worker-pool/stargazers","contributors_url":"https://api.github.com/repos/redding/dat-worker-pool/contributors","subscribers_url":"https://api.github.com/repos/redding/dat-worker-pool/subscribers","subscription_url":"https://api.github.com/repos/redding/dat-worker-pool/subscription","commits_url":"https://api.github.com/repos/redding/dat-worker-pool/commits{/sha}","git_commits_url":"https://api.github.com/repos/redding/dat-worker-pool/git/commits{/sha}","comments_url":"https://api.github.com/repos/redding/dat-worker-pool/comments{/number}","issue_comment_url":"https://api.github.com/repos/redding/dat-worker-pool/issues/comments{/number}","contents_url":"https://api.github.com/repos/redding/dat-worker-pool/contents/{+path}","compare_url":"https://api.github.com/repos/redding/dat-worker-pool/compare/{base}...{head}","merges_url":"https://api.github.com/repos/redding/dat-worker-pool/merges","archive_url":"https://api.github.com/repos/redding/dat-worker-pool/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/redding/dat-worker-pool/downloads","issues_url":"https://api.github.com/repos/redding/dat-worker-pool/issues{/number}","pulls_url":"https://api.github.com/repos/redding/dat-worker-pool/pulls{/number}","milestones_url":"https://api.github.com/repos/redding/dat-worker-pool/milestones{/number}","notifications_url":"https://api.github.com/repos/redding/dat-worker-pool/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/redding/dat-worker-pool/labels{/name}","releases_url":"https://api.github.com/repos/redding/dat-worker-pool/releases{/id}","created_at":"2013-07-09T05:32:00Z","updated_at":"2015-04-22T16:00:08Z","pushed_at":"2015-10-31T13:37:01Z","git_url":"git://github.com/redding/dat-worker-pool.git","ssh_url":"git@github.com:redding/dat-worker-pool.git","clone_url":"https://github.com/redding/dat-worker-pool.git","svn_url":"https://github.com/redding/dat-worker-pool","homepage":null,"size":492,"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":4,"forks":0,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22"},"html":{"href":"https://github.com/redding/dat-worker-pool/pull/22"},"issue":{"href":"https://api.github.com/repos/redding/dat-worker-pool/issues/22"},"comments":{"href":"https://api.github.com/repos/redding/dat-worker-pool/issues/22/comments"},"review_comments":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22/comments"},"review_comment":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/redding/dat-worker-pool/pulls/22/commits"},"statuses":{"href":"https://api.github.com/repos/redding/dat-worker-pool/statuses/6a28715e0bd11b18579077d5471a9c0e655b01f6"}}}}