{"action":"created","issue":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/286","repository_url":"https://api.github.com/repos/sandstorm-io/capnproto","labels_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/286/labels{/name}","comments_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/286/comments","events_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/286/events","html_url":"https://github.com/sandstorm-io/capnproto/issues/286","id":134364567,"number":286,"title":"void TaskSet::wait(WaitScope& waitScope)","user":{"login":"szenker","id":1105001,"avatar_url":"https://avatars.githubusercontent.com/u/1105001?v=3","gravatar_id":"","url":"https://api.github.com/users/szenker","html_url":"https://github.com/szenker","followers_url":"https://api.github.com/users/szenker/followers","following_url":"https://api.github.com/users/szenker/following{/other_user}","gists_url":"https://api.github.com/users/szenker/gists{/gist_id}","starred_url":"https://api.github.com/users/szenker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szenker/subscriptions","organizations_url":"https://api.github.com/users/szenker/orgs","repos_url":"https://api.github.com/users/szenker/repos","events_url":"https://api.github.com/users/szenker/events{/privacy}","received_events_url":"https://api.github.com/users/szenker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-02-17T18:44:44Z","updated_at":"2016-02-22T18:17:57Z","closed_at":null,"body":"Wouldn't it be useful to have TaskSet::wait(WaitScope& waitScope) available which blocks until all queued promises are fulfilled (or rejected)?"},"comment":{"url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/comments/187302770","html_url":"https://github.com/sandstorm-io/capnproto/issues/286#issuecomment-187302770","issue_url":"https://api.github.com/repos/sandstorm-io/capnproto/issues/286","id":187302770,"user":{"login":"kentonv","id":4001805,"avatar_url":"https://avatars.githubusercontent.com/u/4001805?v=3","gravatar_id":"","url":"https://api.github.com/users/kentonv","html_url":"https://github.com/kentonv","followers_url":"https://api.github.com/users/kentonv/followers","following_url":"https://api.github.com/users/kentonv/following{/other_user}","gists_url":"https://api.github.com/users/kentonv/gists{/gist_id}","starred_url":"https://api.github.com/users/kentonv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentonv/subscriptions","organizations_url":"https://api.github.com/users/kentonv/orgs","repos_url":"https://api.github.com/users/kentonv/repos","events_url":"https://api.github.com/users/kentonv/events{/privacy}","received_events_url":"https://api.github.com/users/kentonv/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T18:17:56Z","updated_at":"2016-02-22T18:17:56Z","body":"Oh I see, I was thinking your program flow was:\r\n\r\n1. Add things to TaskSet.\r\n2. TaskSet::wait().\r\n\r\nBut now I see you have a long-running app, and what you're saying is that when the user chooses to exit, you want to wait on whatever is left over.\r\n\r\nMy approach could be leaky. It will only leak in the case that some old, long task is still waiting and lots of new tasks have come and gone in the meantime -- in this case a chain to the old task will stick around. Once the old task finishes then the chain is cleaned up.\r\n\r\nI agree this is not ideal. I guess TaskSet::allDone() makes sense."}}