{"action":"created","issue":{"url":"https://api.github.com/repos/twitter/util/issues/143","labels_url":"https://api.github.com/repos/twitter/util/issues/143/labels{/name}","comments_url":"https://api.github.com/repos/twitter/util/issues/143/comments","events_url":"https://api.github.com/repos/twitter/util/issues/143/events","html_url":"https://github.com/twitter/util/pull/143","id":110750823,"number":143,"title":"Future.sequence","user":{"login":"Chandler","id":55420,"avatar_url":"https://avatars.githubusercontent.com/u/55420?v=3","gravatar_id":"","url":"https://api.github.com/users/Chandler","html_url":"https://github.com/Chandler","followers_url":"https://api.github.com/users/Chandler/followers","following_url":"https://api.github.com/users/Chandler/following{/other_user}","gists_url":"https://api.github.com/users/Chandler/gists{/gist_id}","starred_url":"https://api.github.com/users/Chandler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chandler/subscriptions","organizations_url":"https://api.github.com/users/Chandler/orgs","repos_url":"https://api.github.com/users/Chandler/repos","events_url":"https://api.github.com/users/Chandler/events{/privacy}","received_events_url":"https://api.github.com/users/Chandler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-10-09T23:21:36Z","updated_at":"2015-10-12T21:05:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/twitter/util/pulls/143","html_url":"https://github.com/twitter/util/pull/143","diff_url":"https://github.com/twitter/util/pull/143.diff","patch_url":"https://github.com/twitter/util/pull/143.patch"},"body":"Add a method that allows you to execute an list of futures sequentially\r\n\r\nProblem\r\nMost methods that operate on lists of futures do so in parallel, because it's generally inefficient to sequence futures that don't depend on each other.\r\n\r\nHowever there are some use cases for sequencing futures, such as executing side effects that must take place in order. \r\n\r\nSolution\r\n\r\nAdd a method `sequence` to Future that takes a list of functions that produce futures, and flatMaps them together. We take a list of functions because if you created a list of futures directly, they would already be executing in parallel.\r\n\r\nResult\r\n\r\nNow you can execute Futures in sequence.\r\n"},"comment":{"url":"https://api.github.com/repos/twitter/util/issues/comments/147522978","html_url":"https://github.com/twitter/util/pull/143#issuecomment-147522978","issue_url":"https://api.github.com/repos/twitter/util/issues/143","id":147522978,"user":{"login":"k4rthik","id":691986,"avatar_url":"https://avatars.githubusercontent.com/u/691986?v=3","gravatar_id":"","url":"https://api.github.com/users/k4rthik","html_url":"https://github.com/k4rthik","followers_url":"https://api.github.com/users/k4rthik/followers","following_url":"https://api.github.com/users/k4rthik/following{/other_user}","gists_url":"https://api.github.com/users/k4rthik/gists{/gist_id}","starred_url":"https://api.github.com/users/k4rthik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k4rthik/subscriptions","organizations_url":"https://api.github.com/users/k4rthik/orgs","repos_url":"https://api.github.com/users/k4rthik/repos","events_url":"https://api.github.com/users/k4rthik/events{/privacy}","received_events_url":"https://api.github.com/users/k4rthik/received_events","type":"User","site_admin":false},"created_at":"2015-10-12T21:05:52Z","updated_at":"2015-10-12T21:05:52Z","body":"@luciferous Edited the example to be more clear. This should rollback the operations that were successful. Trascation is started in insertRecords and used in each insertRecord."}}