{"action":"created","comment":{"url":"https://api.github.com/repos/akka/akka/pulls/comments/47342858","id":47342858,"diff_hunk":"@@ -219,6 +219,47 @@ class SourceSpec extends AkkaSpec {\n     }\n   }\n \n+  \"Unfold Source\" must {\n+    val expected = List(9227465, 5702887, 3524578, 2178309, 1346269, 832040, 514229, 317811, 196418, 121393, 75025, 46368, 28657, 17711, 10946, 6765, 4181, 2584, 1597, 987, 610, 377, 233, 144, 89, 55, 34, 21, 13, 8, 5, 3, 2, 1, 1, 0)\n+\n+    \"generate a finite fibonacci sequence\" in {\n+      import GraphDSL.Implicits._\n+\n+      val source = Source.unfold(0 → 1) {\n+        case (a, _) if a > 10000000 ⇒ None\n+        case (a, b)                 ⇒ Some((b → (a + b)) → a)\n+      }\n+      val result = Await.result(source.runFold(List.empty[Int]) { case (xs, x) ⇒ x :: xs }, 1.second)\n+      result should ===(expected)\n+    }\n+\n+    \"generate a finite fibonacci sequence asynchronously\" in {\n+      import GraphDSL.Implicits._\n+      import scala.concurrent.Future\n+      import scala.concurrent.ExecutionContext.Implicits.global\n+\n+      val source = Source.unfoldAsync(0 → 1) {\n+        case (a, _) if a > 10000000 ⇒ Future.successful(None)","path":"akka-stream-tests/src/test/scala/akka/stream/scaladsl/SourceSpec.scala","position":24,"original_position":24,"commit_id":"4a140ca930f7bc93e60f7b2c44a3f6d881e67b17","original_commit_id":"4a140ca930f7bc93e60f7b2c44a3f6d881e67b17","user":{"login":"johanandren","id":666915,"avatar_url":"https://avatars.githubusercontent.com/u/666915?v=3","gravatar_id":"","url":"https://api.github.com/users/johanandren","html_url":"https://github.com/johanandren","followers_url":"https://api.github.com/users/johanandren/followers","following_url":"https://api.github.com/users/johanandren/following{/other_user}","gists_url":"https://api.github.com/users/johanandren/gists{/gist_id}","starred_url":"https://api.github.com/users/johanandren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johanandren/subscriptions","organizations_url":"https://api.github.com/users/johanandren/orgs","repos_url":"https://api.github.com/users/johanandren/repos","events_url":"https://api.github.com/users/johanandren/events{/privacy}","received_events_url":"https://api.github.com/users/johanandren/received_events","type":"User","site_admin":false},"body":"Do we really need to do this 10 000 000 times before we are sure it works as expected?","created_at":"2015-12-11T10:48:35Z","updated_at":"2015-12-11T10:48:35Z","html_url":"https://github.com/akka/akka/pull/19143#discussion_r47342858","pull_request_url":"https://api.github.com/repos/akka/akka/pulls/19143","_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/comments/47342858"},"html":{"href":"https://github.com/akka/akka/pull/19143#discussion_r47342858"},"pull_request":{"href":"https://api.github.com/repos/akka/akka/pulls/19143"}}},"pull_request":{"url":"https://api.github.com/repos/akka/akka/pulls/19143","id":53243036,"html_url":"https://github.com/akka/akka/pull/19143","diff_url":"https://github.com/akka/akka/pull/19143.diff","patch_url":"https://github.com/akka/akka/pull/19143.patch","issue_url":"https://api.github.com/repos/akka/akka/issues/19143","number":19143,"state":"open","locked":false,"title":"+str #19021 Add unfold (and variants) generators to Source","user":{"login":"hochgi","id":881075,"avatar_url":"https://avatars.githubusercontent.com/u/881075?v=3","gravatar_id":"","url":"https://api.github.com/users/hochgi","html_url":"https://github.com/hochgi","followers_url":"https://api.github.com/users/hochgi/followers","following_url":"https://api.github.com/users/hochgi/following{/other_user}","gists_url":"https://api.github.com/users/hochgi/gists{/gist_id}","starred_url":"https://api.github.com/users/hochgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hochgi/subscriptions","organizations_url":"https://api.github.com/users/hochgi/orgs","repos_url":"https://api.github.com/users/hochgi/repos","events_url":"https://api.github.com/users/hochgi/events{/privacy}","received_events_url":"https://api.github.com/users/hochgi/received_events","type":"User","site_admin":false},"body":"see #19021 ","created_at":"2015-12-10T10:56:50Z","updated_at":"2015-12-11T10:48:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d5a4cf75fb3d6a99006de15e48a652c1006e3833","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/akka/akka/pulls/19143/commits","review_comments_url":"https://api.github.com/repos/akka/akka/pulls/19143/comments","review_comment_url":"https://api.github.com/repos/akka/akka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/akka/akka/issues/19143/comments","statuses_url":"https://api.github.com/repos/akka/akka/statuses/4a140ca930f7bc93e60f7b2c44a3f6d881e67b17","head":{"label":"hochgi:hochgi-19021-unfold","ref":"hochgi-19021-unfold","sha":"4a140ca930f7bc93e60f7b2c44a3f6d881e67b17","user":{"login":"hochgi","id":881075,"avatar_url":"https://avatars.githubusercontent.com/u/881075?v=3","gravatar_id":"","url":"https://api.github.com/users/hochgi","html_url":"https://github.com/hochgi","followers_url":"https://api.github.com/users/hochgi/followers","following_url":"https://api.github.com/users/hochgi/following{/other_user}","gists_url":"https://api.github.com/users/hochgi/gists{/gist_id}","starred_url":"https://api.github.com/users/hochgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hochgi/subscriptions","organizations_url":"https://api.github.com/users/hochgi/orgs","repos_url":"https://api.github.com/users/hochgi/repos","events_url":"https://api.github.com/users/hochgi/events{/privacy}","received_events_url":"https://api.github.com/users/hochgi/received_events","type":"User","site_admin":false},"repo":{"id":47703718,"name":"akka","full_name":"hochgi/akka","owner":{"login":"hochgi","id":881075,"avatar_url":"https://avatars.githubusercontent.com/u/881075?v=3","gravatar_id":"","url":"https://api.github.com/users/hochgi","html_url":"https://github.com/hochgi","followers_url":"https://api.github.com/users/hochgi/followers","following_url":"https://api.github.com/users/hochgi/following{/other_user}","gists_url":"https://api.github.com/users/hochgi/gists{/gist_id}","starred_url":"https://api.github.com/users/hochgi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hochgi/subscriptions","organizations_url":"https://api.github.com/users/hochgi/orgs","repos_url":"https://api.github.com/users/hochgi/repos","events_url":"https://api.github.com/users/hochgi/events{/privacy}","received_events_url":"https://api.github.com/users/hochgi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/hochgi/akka","description":"Akka Project","fork":true,"url":"https://api.github.com/repos/hochgi/akka","forks_url":"https://api.github.com/repos/hochgi/akka/forks","keys_url":"https://api.github.com/repos/hochgi/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hochgi/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hochgi/akka/teams","hooks_url":"https://api.github.com/repos/hochgi/akka/hooks","issue_events_url":"https://api.github.com/repos/hochgi/akka/issues/events{/number}","events_url":"https://api.github.com/repos/hochgi/akka/events","assignees_url":"https://api.github.com/repos/hochgi/akka/assignees{/user}","branches_url":"https://api.github.com/repos/hochgi/akka/branches{/branch}","tags_url":"https://api.github.com/repos/hochgi/akka/tags","blobs_url":"https://api.github.com/repos/hochgi/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hochgi/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hochgi/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/hochgi/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hochgi/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/hochgi/akka/languages","stargazers_url":"https://api.github.com/repos/hochgi/akka/stargazers","contributors_url":"https://api.github.com/repos/hochgi/akka/contributors","subscribers_url":"https://api.github.com/repos/hochgi/akka/subscribers","subscription_url":"https://api.github.com/repos/hochgi/akka/subscription","commits_url":"https://api.github.com/repos/hochgi/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/hochgi/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/hochgi/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/hochgi/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/hochgi/akka/contents/{+path}","compare_url":"https://api.github.com/repos/hochgi/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hochgi/akka/merges","archive_url":"https://api.github.com/repos/hochgi/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hochgi/akka/downloads","issues_url":"https://api.github.com/repos/hochgi/akka/issues{/number}","pulls_url":"https://api.github.com/repos/hochgi/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/hochgi/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/hochgi/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hochgi/akka/labels{/name}","releases_url":"https://api.github.com/repos/hochgi/akka/releases{/id}","created_at":"2015-12-09T16:27:15Z","updated_at":"2015-12-09T16:27:23Z","pushed_at":"2015-12-11T10:32:17Z","git_url":"git://github.com/hochgi/akka.git","ssh_url":"git@github.com:hochgi/akka.git","clone_url":"https://github.com/hochgi/akka.git","svn_url":"https://github.com/hochgi/akka","homepage":"http://akka.io","size":170345,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"akka:release-2.3-dev","ref":"release-2.3-dev","sha":"d929ba15ba4a82e6509ace4e9491a67e8d1b3770","user":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"repo":{"id":130013,"name":"akka","full_name":"akka/akka","owner":{"login":"akka","id":1496237,"avatar_url":"https://avatars.githubusercontent.com/u/1496237?v=3","gravatar_id":"","url":"https://api.github.com/users/akka","html_url":"https://github.com/akka","followers_url":"https://api.github.com/users/akka/followers","following_url":"https://api.github.com/users/akka/following{/other_user}","gists_url":"https://api.github.com/users/akka/gists{/gist_id}","starred_url":"https://api.github.com/users/akka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akka/subscriptions","organizations_url":"https://api.github.com/users/akka/orgs","repos_url":"https://api.github.com/users/akka/repos","events_url":"https://api.github.com/users/akka/events{/privacy}","received_events_url":"https://api.github.com/users/akka/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/akka/akka","description":"Akka Project","fork":false,"url":"https://api.github.com/repos/akka/akka","forks_url":"https://api.github.com/repos/akka/akka/forks","keys_url":"https://api.github.com/repos/akka/akka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akka/akka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akka/akka/teams","hooks_url":"https://api.github.com/repos/akka/akka/hooks","issue_events_url":"https://api.github.com/repos/akka/akka/issues/events{/number}","events_url":"https://api.github.com/repos/akka/akka/events","assignees_url":"https://api.github.com/repos/akka/akka/assignees{/user}","branches_url":"https://api.github.com/repos/akka/akka/branches{/branch}","tags_url":"https://api.github.com/repos/akka/akka/tags","blobs_url":"https://api.github.com/repos/akka/akka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akka/akka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akka/akka/git/refs{/sha}","trees_url":"https://api.github.com/repos/akka/akka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akka/akka/statuses/{sha}","languages_url":"https://api.github.com/repos/akka/akka/languages","stargazers_url":"https://api.github.com/repos/akka/akka/stargazers","contributors_url":"https://api.github.com/repos/akka/akka/contributors","subscribers_url":"https://api.github.com/repos/akka/akka/subscribers","subscription_url":"https://api.github.com/repos/akka/akka/subscription","commits_url":"https://api.github.com/repos/akka/akka/commits{/sha}","git_commits_url":"https://api.github.com/repos/akka/akka/git/commits{/sha}","comments_url":"https://api.github.com/repos/akka/akka/comments{/number}","issue_comment_url":"https://api.github.com/repos/akka/akka/issues/comments{/number}","contents_url":"https://api.github.com/repos/akka/akka/contents/{+path}","compare_url":"https://api.github.com/repos/akka/akka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akka/akka/merges","archive_url":"https://api.github.com/repos/akka/akka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akka/akka/downloads","issues_url":"https://api.github.com/repos/akka/akka/issues{/number}","pulls_url":"https://api.github.com/repos/akka/akka/pulls{/number}","milestones_url":"https://api.github.com/repos/akka/akka/milestones{/number}","notifications_url":"https://api.github.com/repos/akka/akka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akka/akka/labels{/name}","releases_url":"https://api.github.com/repos/akka/akka/releases{/id}","created_at":"2009-02-16T12:51:54Z","updated_at":"2015-12-11T10:26:44Z","pushed_at":"2015-12-11T10:32:18Z","git_url":"git://github.com/akka/akka.git","ssh_url":"git@github.com:akka/akka.git","clone_url":"https://github.com/akka/akka.git","svn_url":"https://github.com/akka/akka","homepage":"http://akka.io","size":178529,"stargazers_count":4816,"watchers_count":4816,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1455,"mirror_url":null,"open_issues_count":808,"forks":1455,"open_issues":808,"watchers":4816,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/akka/akka/pulls/19143"},"html":{"href":"https://github.com/akka/akka/pull/19143"},"issue":{"href":"https://api.github.com/repos/akka/akka/issues/19143"},"comments":{"href":"https://api.github.com/repos/akka/akka/issues/19143/comments"},"review_comments":{"href":"https://api.github.com/repos/akka/akka/pulls/19143/comments"},"review_comment":{"href":"https://api.github.com/repos/akka/akka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/akka/akka/pulls/19143/commits"},"statuses":{"href":"https://api.github.com/repos/akka/akka/statuses/4a140ca930f7bc93e60f7b2c44a3f6d881e67b17"}}}}