{"action":"created","issue":{"url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/1099","labels_url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/1099/labels{/name}","comments_url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/1099/comments","events_url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/1099/events","html_url":"https://github.com/cooperative-computing-lab/cctools/issues/1099","id":126929154,"number":1099,"title":"Ability to drain a Work Queue Factory","user":{"login":"klannon","id":5149849,"avatar_url":"https://avatars.githubusercontent.com/u/5149849?v=3","gravatar_id":"","url":"https://api.github.com/users/klannon","html_url":"https://github.com/klannon","followers_url":"https://api.github.com/users/klannon/followers","following_url":"https://api.github.com/users/klannon/following{/other_user}","gists_url":"https://api.github.com/users/klannon/gists{/gist_id}","starred_url":"https://api.github.com/users/klannon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klannon/subscriptions","organizations_url":"https://api.github.com/users/klannon/orgs","repos_url":"https://api.github.com/users/klannon/repos","events_url":"https://api.github.com/users/klannon/events{/privacy}","received_events_url":"https://api.github.com/users/klannon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cooperative-computing-lab/cctools/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/cooperative-computing-lab/cctools/labels/Work%20Queue","name":"Work Queue","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"charleszheng44","id":4213464,"avatar_url":"https://avatars.githubusercontent.com/u/4213464?v=3","gravatar_id":"","url":"https://api.github.com/users/charleszheng44","html_url":"https://github.com/charleszheng44","followers_url":"https://api.github.com/users/charleszheng44/followers","following_url":"https://api.github.com/users/charleszheng44/following{/other_user}","gists_url":"https://api.github.com/users/charleszheng44/gists{/gist_id}","starred_url":"https://api.github.com/users/charleszheng44/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charleszheng44/subscriptions","organizations_url":"https://api.github.com/users/charleszheng44/orgs","repos_url":"https://api.github.com/users/charleszheng44/repos","events_url":"https://api.github.com/users/charleszheng44/events{/privacy}","received_events_url":"https://api.github.com/users/charleszheng44/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-01-15T18:25:59Z","updated_at":"2016-01-15T19:13:05Z","closed_at":null,"body":"I'm not sure if this is even a sensible request, but it would be really nice if you could \"drain\" a work queue factory--in other words, tell a factory that it should reduce the number of connected workers, but only by removing workers after they complete their current tasks."},"comment":{"url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/comments/172057044","html_url":"https://github.com/cooperative-computing-lab/cctools/issues/1099#issuecomment-172057044","issue_url":"https://api.github.com/repos/cooperative-computing-lab/cctools/issues/1099","id":172057044,"user":{"login":"btovar","id":3081826,"avatar_url":"https://avatars.githubusercontent.com/u/3081826?v=3","gravatar_id":"","url":"https://api.github.com/users/btovar","html_url":"https://github.com/btovar","followers_url":"https://api.github.com/users/btovar/followers","following_url":"https://api.github.com/users/btovar/following{/other_user}","gists_url":"https://api.github.com/users/btovar/gists{/gist_id}","starred_url":"https://api.github.com/users/btovar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/btovar/subscriptions","organizations_url":"https://api.github.com/users/btovar/orgs","repos_url":"https://api.github.com/users/btovar/repos","events_url":"https://api.github.com/users/btovar/events{/privacy}","received_events_url":"https://api.github.com/users/btovar/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T19:13:05Z","updated_at":"2016-01-15T19:13:05Z","body":"Ah, indeed. \r\n\r\nThe behavior that you describe is already there, without the need of drain: true. Simply set max_workers and min_workers to 0, workers are not regenerated, and the idle out as the master sends less work.\r\n\r\nHowever, if you do not like the waiting for the idling out, then I do not see how we can do this from work_queue_factory alone. \r\n"}}