{"action":"created","comment":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/40660828","id":40660828,"diff_hunk":"@@ -39,38 +39,54 @@ BlockedQueueTest: class extends Fixture {\n \t\t\texpect(queue count, is equal to(0))\n \n \t\t\tpool := ThreadPool new(8)\n+\t\t\tlimitA := 100\n+\t\t\tlimitB := 200\n+\t\t\tlimitC := 200\n+\t\t\tlimitD := 20\n+\t\t\tlimitE := 4\n+\t\t\tlimitF := 4\n+\t\t\tpromises := Promise[limitA + limitB + limitC + limitD + limitE + limitF] new()\n \t\t\t/* Enqueue values asynchronously */\n-\t\t\tfor (i in 0 .. 100)\n-\t\t\t\tpool add(func1)\n+\t\t\tfor (i in 0 .. limitA)\n+\t\t\t\tpromises[i] = pool getPromise(func1)\n \n \t\t\t/* Peek values asynchronously */\n-\t\t\tfor (i in 0 .. 200)\n-\t\t\t\tpool add(func2)\n+\t\t\tfor (i in 0 .. limitB)\n+\t\t\t\tpromises[limitA + i] = pool getPromise(func2)\n \n \t\t\t/* Dequeue values asynchronously */\n-\t\t\tfor (i in 0 .. 200)\n-\t\t\t\tpool add(func3)\n+\t\t\tfor (i in 0 .. limitC)\n+\t\t\t\tpromises[limitA + limitB + i] = pool getPromise(func3)\n \n \t\t\t/* Peek values asynchronously in empty Queue */\n-\t\t\tfor (i in 0 .. 20)\n-\t\t\t\tpool add(func4)\n+\t\t\tfor (i in 0 .. limitD)\n+\t\t\t\tpromises[limitA + limitB + limitC + i] = pool getPromise(func4)\n \n-\t\t\tpool waitAll()\n+\t\t\t//TODO This is not pretty but replaces waitAll for now\n+\t\t\tfor (i in 0 .. limitA + limitB + limitC + limitD)\n+\t\t\t\tpromises[i] wait()\n \n \t\t\texpect(queue empty)\n \t\t\texpect(queue count, is equal to(0))\n \n \t\t\tfor (i in 0 .. 4) {\n-\t\t\t\tpool add(func5)\n+\t\t\t\tpromises[limitA + limitB + limitC + limitD + i] = pool getPromise(func5)\n \t\t\t\tTime sleepMilli(10)\n \t\t\t}\n \t\t\tfor (i in 0 .. 4) {\n-\t\t\t\tpool add(func1)\n+\t\t\t\tpromises[limitA + limitB + limitC + limitD + limitE + i] = pool getPromise(func1)\n \t\t\t\tTime sleepMilli(10)\n \t\t\t}\n-\t\t\tpool waitAll()\n+\n+\t\t\t//TODO This is not pretty but replaces waitAll for now\n+\t\t\tfor (i in 0 .. limitA + limitB + limitC + limitD + limitE + limitF) {\n+\t\t\t\tpromises[i] wait()\n+\t\t\t\tpromises[i] free()","path":"test/collections/BlockedQueueTest.ooc","position":58,"original_position":58,"commit_id":"5f7f2606c206f27088b2c10a40ae87a5fb16e73e","original_commit_id":"5f7f2606c206f27088b2c10a40ae87a5fb16e73e","user":{"login":"davidhesselbom","id":4319680,"avatar_url":"https://avatars.githubusercontent.com/u/4319680?v=3","gravatar_id":"","url":"https://api.github.com/users/davidhesselbom","html_url":"https://github.com/davidhesselbom","followers_url":"https://api.github.com/users/davidhesselbom/followers","following_url":"https://api.github.com/users/davidhesselbom/following{/other_user}","gists_url":"https://api.github.com/users/davidhesselbom/gists{/gist_id}","starred_url":"https://api.github.com/users/davidhesselbom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidhesselbom/subscriptions","organizations_url":"https://api.github.com/users/davidhesselbom/orgs","repos_url":"https://api.github.com/users/davidhesselbom/repos","events_url":"https://api.github.com/users/davidhesselbom/events{/privacy}","received_events_url":"https://api.github.com/users/davidhesselbom/received_events","type":"User","site_admin":false},"body":"And here...","created_at":"2015-09-29T11:39:39Z","updated_at":"2015-09-29T11:39:39Z","html_url":"https://github.com/cogneco/ooc-kean/pull/438#discussion_r40660828","pull_request_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438","_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments/40660828"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/438#discussion_r40660828"},"pull_request":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438"}}},"pull_request":{"url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438","id":46011873,"html_url":"https://github.com/cogneco/ooc-kean/pull/438","diff_url":"https://github.com/cogneco/ooc-kean/pull/438.diff","patch_url":"https://github.com/cogneco/ooc-kean/pull/438.patch","issue_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/438","number":438,"state":"open","locked":false,"title":"New Integration of Promises with Threadpool","user":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"body":"Multiple bug fixes and general code cleanup. \r\nResultPromise has been renamed to Future\r\nwait() and waitAll() removed from ThreadPool which will break code in vidproc (another pull request there will fix this)\r\n","created_at":"2015-09-25T13:31:44Z","updated_at":"2015-09-29T11:39:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d1e02ce4d48080536727c640a6510e0f4007e43","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438/commits","review_comments_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438/comments","review_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/438/comments","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/5f7f2606c206f27088b2c10a40ae87a5fb16e73e","head":{"label":"marcusnaslund:threadpool-promises","ref":"threadpool-promises","sha":"5f7f2606c206f27088b2c10a40ae87a5fb16e73e","user":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"repo":{"id":42990201,"name":"ooc-kean","full_name":"marcusnaslund/ooc-kean","owner":{"login":"marcusnaslund","id":14308896,"avatar_url":"https://avatars.githubusercontent.com/u/14308896?v=3","gravatar_id":"","url":"https://api.github.com/users/marcusnaslund","html_url":"https://github.com/marcusnaslund","followers_url":"https://api.github.com/users/marcusnaslund/followers","following_url":"https://api.github.com/users/marcusnaslund/following{/other_user}","gists_url":"https://api.github.com/users/marcusnaslund/gists{/gist_id}","starred_url":"https://api.github.com/users/marcusnaslund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcusnaslund/subscriptions","organizations_url":"https://api.github.com/users/marcusnaslund/orgs","repos_url":"https://api.github.com/users/marcusnaslund/repos","events_url":"https://api.github.com/users/marcusnaslund/events{/privacy}","received_events_url":"https://api.github.com/users/marcusnaslund/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcusnaslund/ooc-kean","description":"ooc port of parts of Kean.","fork":true,"url":"https://api.github.com/repos/marcusnaslund/ooc-kean","forks_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/forks","keys_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/teams","hooks_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/events","assignees_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/tags","blobs_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/subscription","commits_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/merges","archive_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/downloads","issues_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/marcusnaslund/ooc-kean/releases{/id}","created_at":"2015-09-23T09:03:37Z","updated_at":"2015-09-23T09:03:39Z","pushed_at":"2015-09-29T11:14:14Z","git_url":"git://github.com/marcusnaslund/ooc-kean.git","ssh_url":"git@github.com:marcusnaslund/ooc-kean.git","clone_url":"https://github.com/marcusnaslund/ooc-kean.git","svn_url":"https://github.com/marcusnaslund/ooc-kean","homepage":"","size":12364,"stargazers_count":0,"watchers_count":0,"language":"ooc","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cogneco:master","ref":"master","sha":"4da6b3225738bd53b9d70e9e4477cdda90401f48","user":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"repo":{"id":25256330,"name":"ooc-kean","full_name":"cogneco/ooc-kean","owner":{"login":"cogneco","id":3601419,"avatar_url":"https://avatars.githubusercontent.com/u/3601419?v=3","gravatar_id":"","url":"https://api.github.com/users/cogneco","html_url":"https://github.com/cogneco","followers_url":"https://api.github.com/users/cogneco/followers","following_url":"https://api.github.com/users/cogneco/following{/other_user}","gists_url":"https://api.github.com/users/cogneco/gists{/gist_id}","starred_url":"https://api.github.com/users/cogneco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cogneco/subscriptions","organizations_url":"https://api.github.com/users/cogneco/orgs","repos_url":"https://api.github.com/users/cogneco/repos","events_url":"https://api.github.com/users/cogneco/events{/privacy}","received_events_url":"https://api.github.com/users/cogneco/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cogneco/ooc-kean","description":"ooc port of parts of Kean.","fork":false,"url":"https://api.github.com/repos/cogneco/ooc-kean","forks_url":"https://api.github.com/repos/cogneco/ooc-kean/forks","keys_url":"https://api.github.com/repos/cogneco/ooc-kean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cogneco/ooc-kean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cogneco/ooc-kean/teams","hooks_url":"https://api.github.com/repos/cogneco/ooc-kean/hooks","issue_events_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/events{/number}","events_url":"https://api.github.com/repos/cogneco/ooc-kean/events","assignees_url":"https://api.github.com/repos/cogneco/ooc-kean/assignees{/user}","branches_url":"https://api.github.com/repos/cogneco/ooc-kean/branches{/branch}","tags_url":"https://api.github.com/repos/cogneco/ooc-kean/tags","blobs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cogneco/ooc-kean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cogneco/ooc-kean/git/refs{/sha}","trees_url":"https://api.github.com/repos/cogneco/ooc-kean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cogneco/ooc-kean/statuses/{sha}","languages_url":"https://api.github.com/repos/cogneco/ooc-kean/languages","stargazers_url":"https://api.github.com/repos/cogneco/ooc-kean/stargazers","contributors_url":"https://api.github.com/repos/cogneco/ooc-kean/contributors","subscribers_url":"https://api.github.com/repos/cogneco/ooc-kean/subscribers","subscription_url":"https://api.github.com/repos/cogneco/ooc-kean/subscription","commits_url":"https://api.github.com/repos/cogneco/ooc-kean/commits{/sha}","git_commits_url":"https://api.github.com/repos/cogneco/ooc-kean/git/commits{/sha}","comments_url":"https://api.github.com/repos/cogneco/ooc-kean/comments{/number}","issue_comment_url":"https://api.github.com/repos/cogneco/ooc-kean/issues/comments{/number}","contents_url":"https://api.github.com/repos/cogneco/ooc-kean/contents/{+path}","compare_url":"https://api.github.com/repos/cogneco/ooc-kean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cogneco/ooc-kean/merges","archive_url":"https://api.github.com/repos/cogneco/ooc-kean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cogneco/ooc-kean/downloads","issues_url":"https://api.github.com/repos/cogneco/ooc-kean/issues{/number}","pulls_url":"https://api.github.com/repos/cogneco/ooc-kean/pulls{/number}","milestones_url":"https://api.github.com/repos/cogneco/ooc-kean/milestones{/number}","notifications_url":"https://api.github.com/repos/cogneco/ooc-kean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cogneco/ooc-kean/labels{/name}","releases_url":"https://api.github.com/repos/cogneco/ooc-kean/releases{/id}","created_at":"2014-10-15T13:42:17Z","updated_at":"2015-05-08T13:13:16Z","pushed_at":"2015-09-29T11:34:08Z","git_url":"git://github.com/cogneco/ooc-kean.git","ssh_url":"git@github.com:cogneco/ooc-kean.git","clone_url":"https://github.com/cogneco/ooc-kean.git","svn_url":"https://github.com/cogneco/ooc-kean","homepage":"","size":15611,"stargazers_count":3,"watchers_count":3,"language":"ooc","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"open_issues_count":15,"forks":16,"open_issues":15,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438"},"html":{"href":"https://github.com/cogneco/ooc-kean/pull/438"},"issue":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/438"},"comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/issues/438/comments"},"review_comments":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438/comments"},"review_comment":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cogneco/ooc-kean/pulls/438/commits"},"statuses":{"href":"https://api.github.com/repos/cogneco/ooc-kean/statuses/5f7f2606c206f27088b2c10a40ae87a5fb16e73e"}}}}