{"action":"created","issue":{"url":"https://api.github.com/repos/generators-io-projects/generators/issues/48","labels_url":"https://api.github.com/repos/generators-io-projects/generators/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/generators-io-projects/generators/issues/48/comments","events_url":"https://api.github.com/repos/generators-io-projects/generators/issues/48/events","html_url":"https://github.com/generators-io-projects/generators/issues/48","id":79487299,"number":48,"title":"Add support for takeWhile on the Generator interface","user":{"login":"blondacz","id":2191996,"avatar_url":"https://avatars.githubusercontent.com/u/2191996?v=3","gravatar_id":"","url":"https://api.github.com/users/blondacz","html_url":"https://github.com/blondacz","followers_url":"https://api.github.com/users/blondacz/followers","following_url":"https://api.github.com/users/blondacz/following{/other_user}","gists_url":"https://api.github.com/users/blondacz/gists{/gist_id}","starred_url":"https://api.github.com/users/blondacz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blondacz/subscriptions","organizations_url":"https://api.github.com/users/blondacz/orgs","repos_url":"https://api.github.com/users/blondacz/repos","events_url":"https://api.github.com/users/blondacz/events{/privacy}","received_events_url":"https://api.github.com/users/blondacz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/generators-io-projects/generators/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/generators-io-projects/generators/milestones/2","html_url":"https://github.com/generators-io-projects/generators/milestones/generators-2.0-RC1","labels_url":"https://api.github.com/repos/generators-io-projects/generators/milestones/2/labels","id":1123217,"number":2,"title":"generators-2.0-RC1","description":"","creator":{"login":"blondacz","id":2191996,"avatar_url":"https://avatars.githubusercontent.com/u/2191996?v=3","gravatar_id":"","url":"https://api.github.com/users/blondacz","html_url":"https://github.com/blondacz","followers_url":"https://api.github.com/users/blondacz/followers","following_url":"https://api.github.com/users/blondacz/following{/other_user}","gists_url":"https://api.github.com/users/blondacz/gists{/gist_id}","starred_url":"https://api.github.com/users/blondacz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blondacz/subscriptions","organizations_url":"https://api.github.com/users/blondacz/orgs","repos_url":"https://api.github.com/users/blondacz/repos","events_url":"https://api.github.com/users/blondacz/events{/privacy}","received_events_url":"https://api.github.com/users/blondacz/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":4,"state":"open","created_at":"2015-05-21T13:21:56Z","updated_at":"2015-05-27T08:02:47Z","due_on":"2015-06-29T23:00:00Z","closed_at":null},"comments":4,"created_at":"2015-05-22T15:00:20Z","updated_at":"2015-05-27T08:13:56Z","closed_at":null,"body":""},"comment":{"url":"https://api.github.com/repos/generators-io-projects/generators/issues/comments/105813353","html_url":"https://github.com/generators-io-projects/generators/issues/48#issuecomment-105813353","issue_url":"https://api.github.com/repos/generators-io-projects/generators/issues/48","id":105813353,"user":{"login":"blondacz","id":2191996,"avatar_url":"https://avatars.githubusercontent.com/u/2191996?v=3","gravatar_id":"","url":"https://api.github.com/users/blondacz","html_url":"https://github.com/blondacz","followers_url":"https://api.github.com/users/blondacz/followers","following_url":"https://api.github.com/users/blondacz/following{/other_user}","gists_url":"https://api.github.com/users/blondacz/gists{/gist_id}","starred_url":"https://api.github.com/users/blondacz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blondacz/subscriptions","organizations_url":"https://api.github.com/users/blondacz/orgs","repos_url":"https://api.github.com/users/blondacz/repos","events_url":"https://api.github.com/users/blondacz/events{/privacy}","received_events_url":"https://api.github.com/users/blondacz/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T08:13:56Z","updated_at":"2015-05-27T08:13:56Z","body":"We are currently using some generators that are sequential. \r\n`takeWhile` is generalization of the the take/limit. I admit there is no easy way of implementing it as so far the only implementation I can think of is based on pre-fetching next value to find out whether generation should end which requires all the actions in the upstream chain (towards the 'root' generator)  to be without side effects as otherwise some actions may be executed after the end of the generation (similar to some guava implementations).\r\n\r\nAlso takeWhile does not need act on the generated values. It can be used to stop generation on some external conditions like time (stop generation after certain time) so it is valid in certain cases even for random generators"}}