{"action":"created","comment":{"url":"https://api.github.com/repos/radix/effect/pulls/comments/29067593","id":29067593,"diff_hunk":"@@ -251,17 +252,25 @@ class SequenceDispatcher(object):\n     runs ``func`` to perform intents in strict sequence.\n \n     So, if you expect to first perform an intent like ``MyIntent('a')`` and\n-    then an intent like ``OtherIntent('b')``, you can create a dispatcher like\n-    this::\n+    then an intent like ``OtherIntent('b')``, you can create and use a\n+    dispatcher like this::\n \n-        SequenceDispatcher([\n+        sequence = SequenceDispatcher([\n             (MyIntent('a'), lambda i: 'my-intent-result'),\n             (OtherIntent('b'), lambda i: 'other-intent-result')\n         ])\n \n+        with sequence.consume():\n+            perform(eff, sequence)\n+\n+    It's important to use `with sequence.consume():` to ensure that all of the\n+    intents are performed. Otherwise, if your code has a bug that causes it to\n+    return before all effects are performed, your test may not fail.\n+\n     :obj:`None` is returned if the next intent in the sequence is not equal to\n     the intent being performed, or if there are no more items left in the\n-    sequence.\n+    sequence (this is standard behavior for dispatchers that don't handle an","path":"effect/testing.py","position":33,"original_position":33,"commit_id":"a9d9f3cdbe51b9b56804554ef144b84b04b9337d","original_commit_id":"832f8a3432eb0144dbfd329533458e958f070761","user":{"login":"cyli","id":223200,"avatar_url":"https://avatars.githubusercontent.com/u/223200?v=3","gravatar_id":"","url":"https://api.github.com/users/cyli","html_url":"https://github.com/cyli","followers_url":"https://api.github.com/users/cyli/followers","following_url":"https://api.github.com/users/cyli/following{/other_user}","gists_url":"https://api.github.com/users/cyli/gists{/gist_id}","starred_url":"https://api.github.com/users/cyli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyli/subscriptions","organizations_url":"https://api.github.com/users/cyli/orgs","repos_url":"https://api.github.com/users/cyli/repos","events_url":"https://api.github.com/users/cyli/events{/privacy}","received_events_url":"https://api.github.com/users/cyli/received_events","type":"User","site_admin":false},"body":"Thanks for the explanation :D","created_at":"2015-04-24T17:23:59Z","updated_at":"2015-04-24T17:23:59Z","html_url":"https://github.com/radix/effect/pull/47#discussion_r29067593","pull_request_url":"https://api.github.com/repos/radix/effect/pulls/47","_links":{"self":{"href":"https://api.github.com/repos/radix/effect/pulls/comments/29067593"},"html":{"href":"https://github.com/radix/effect/pull/47#discussion_r29067593"},"pull_request":{"href":"https://api.github.com/repos/radix/effect/pulls/47"}}},"pull_request":{"url":"https://api.github.com/repos/radix/effect/pulls/47","id":34068345,"html_url":"https://github.com/radix/effect/pull/47","diff_url":"https://github.com/radix/effect/pull/47.diff","patch_url":"https://github.com/radix/effect/pull/47.patch","issue_url":"https://api.github.com/repos/radix/effect/issues/47","number":47,"state":"open","locked":false,"title":"add a context manager to SequenceDispatcher that ensures all intents are performed","user":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"body":"```\r\nwith sequence.consume():\r\n    perform(dispatcher, eff)\r\n```\r\n\r\nraises AssertionError if the perform did not consume all of the sequence.","created_at":"2015-04-24T17:21:20Z","updated_at":"2015-04-24T17:23:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d8f09f708a76c64efee312ce559a1beca32ff00","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/radix/effect/pulls/47/commits","review_comments_url":"https://api.github.com/repos/radix/effect/pulls/47/comments","review_comment_url":"https://api.github.com/repos/radix/effect/pulls/comments{/number}","comments_url":"https://api.github.com/repos/radix/effect/issues/47/comments","statuses_url":"https://api.github.com/repos/radix/effect/statuses/a9d9f3cdbe51b9b56804554ef144b84b04b9337d","head":{"label":"radix:sequence-context-manager","ref":"sequence-context-manager","sha":"a9d9f3cdbe51b9b56804554ef144b84b04b9337d","user":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"repo":{"id":20022094,"name":"effect","full_name":"radix/effect","owner":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radix/effect","description":"effect isolation in Python, to facilitate more purely functional code","fork":false,"url":"https://api.github.com/repos/radix/effect","forks_url":"https://api.github.com/repos/radix/effect/forks","keys_url":"https://api.github.com/repos/radix/effect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radix/effect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radix/effect/teams","hooks_url":"https://api.github.com/repos/radix/effect/hooks","issue_events_url":"https://api.github.com/repos/radix/effect/issues/events{/number}","events_url":"https://api.github.com/repos/radix/effect/events","assignees_url":"https://api.github.com/repos/radix/effect/assignees{/user}","branches_url":"https://api.github.com/repos/radix/effect/branches{/branch}","tags_url":"https://api.github.com/repos/radix/effect/tags","blobs_url":"https://api.github.com/repos/radix/effect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radix/effect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radix/effect/git/refs{/sha}","trees_url":"https://api.github.com/repos/radix/effect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radix/effect/statuses/{sha}","languages_url":"https://api.github.com/repos/radix/effect/languages","stargazers_url":"https://api.github.com/repos/radix/effect/stargazers","contributors_url":"https://api.github.com/repos/radix/effect/contributors","subscribers_url":"https://api.github.com/repos/radix/effect/subscribers","subscription_url":"https://api.github.com/repos/radix/effect/subscription","commits_url":"https://api.github.com/repos/radix/effect/commits{/sha}","git_commits_url":"https://api.github.com/repos/radix/effect/git/commits{/sha}","comments_url":"https://api.github.com/repos/radix/effect/comments{/number}","issue_comment_url":"https://api.github.com/repos/radix/effect/issues/comments{/number}","contents_url":"https://api.github.com/repos/radix/effect/contents/{+path}","compare_url":"https://api.github.com/repos/radix/effect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radix/effect/merges","archive_url":"https://api.github.com/repos/radix/effect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radix/effect/downloads","issues_url":"https://api.github.com/repos/radix/effect/issues{/number}","pulls_url":"https://api.github.com/repos/radix/effect/pulls{/number}","milestones_url":"https://api.github.com/repos/radix/effect/milestones{/number}","notifications_url":"https://api.github.com/repos/radix/effect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radix/effect/labels{/name}","releases_url":"https://api.github.com/repos/radix/effect/releases{/id}","created_at":"2014-05-21T13:26:42Z","updated_at":"2015-04-16T19:52:21Z","pushed_at":"2015-04-24T17:23:54Z","git_url":"git://github.com/radix/effect.git","ssh_url":"git@github.com:radix/effect.git","clone_url":"https://github.com/radix/effect.git","svn_url":"https://github.com/radix/effect","homepage":"","size":1704,"stargazers_count":103,"watchers_count":103,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":15,"forks":8,"open_issues":15,"watchers":103,"default_branch":"master"}},"base":{"label":"radix:master","ref":"master","sha":"d0587946194d3c6d04951933b4d60446f4fa3fc2","user":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"repo":{"id":20022094,"name":"effect","full_name":"radix/effect","owner":{"login":"radix","id":227068,"avatar_url":"https://avatars.githubusercontent.com/u/227068?v=3","gravatar_id":"","url":"https://api.github.com/users/radix","html_url":"https://github.com/radix","followers_url":"https://api.github.com/users/radix/followers","following_url":"https://api.github.com/users/radix/following{/other_user}","gists_url":"https://api.github.com/users/radix/gists{/gist_id}","starred_url":"https://api.github.com/users/radix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radix/subscriptions","organizations_url":"https://api.github.com/users/radix/orgs","repos_url":"https://api.github.com/users/radix/repos","events_url":"https://api.github.com/users/radix/events{/privacy}","received_events_url":"https://api.github.com/users/radix/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/radix/effect","description":"effect isolation in Python, to facilitate more purely functional code","fork":false,"url":"https://api.github.com/repos/radix/effect","forks_url":"https://api.github.com/repos/radix/effect/forks","keys_url":"https://api.github.com/repos/radix/effect/keys{/key_id}","collaborators_url":"https://api.github.com/repos/radix/effect/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/radix/effect/teams","hooks_url":"https://api.github.com/repos/radix/effect/hooks","issue_events_url":"https://api.github.com/repos/radix/effect/issues/events{/number}","events_url":"https://api.github.com/repos/radix/effect/events","assignees_url":"https://api.github.com/repos/radix/effect/assignees{/user}","branches_url":"https://api.github.com/repos/radix/effect/branches{/branch}","tags_url":"https://api.github.com/repos/radix/effect/tags","blobs_url":"https://api.github.com/repos/radix/effect/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/radix/effect/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/radix/effect/git/refs{/sha}","trees_url":"https://api.github.com/repos/radix/effect/git/trees{/sha}","statuses_url":"https://api.github.com/repos/radix/effect/statuses/{sha}","languages_url":"https://api.github.com/repos/radix/effect/languages","stargazers_url":"https://api.github.com/repos/radix/effect/stargazers","contributors_url":"https://api.github.com/repos/radix/effect/contributors","subscribers_url":"https://api.github.com/repos/radix/effect/subscribers","subscription_url":"https://api.github.com/repos/radix/effect/subscription","commits_url":"https://api.github.com/repos/radix/effect/commits{/sha}","git_commits_url":"https://api.github.com/repos/radix/effect/git/commits{/sha}","comments_url":"https://api.github.com/repos/radix/effect/comments{/number}","issue_comment_url":"https://api.github.com/repos/radix/effect/issues/comments{/number}","contents_url":"https://api.github.com/repos/radix/effect/contents/{+path}","compare_url":"https://api.github.com/repos/radix/effect/compare/{base}...{head}","merges_url":"https://api.github.com/repos/radix/effect/merges","archive_url":"https://api.github.com/repos/radix/effect/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/radix/effect/downloads","issues_url":"https://api.github.com/repos/radix/effect/issues{/number}","pulls_url":"https://api.github.com/repos/radix/effect/pulls{/number}","milestones_url":"https://api.github.com/repos/radix/effect/milestones{/number}","notifications_url":"https://api.github.com/repos/radix/effect/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/radix/effect/labels{/name}","releases_url":"https://api.github.com/repos/radix/effect/releases{/id}","created_at":"2014-05-21T13:26:42Z","updated_at":"2015-04-16T19:52:21Z","pushed_at":"2015-04-24T17:23:54Z","git_url":"git://github.com/radix/effect.git","ssh_url":"git@github.com:radix/effect.git","clone_url":"https://github.com/radix/effect.git","svn_url":"https://github.com/radix/effect","homepage":"","size":1704,"stargazers_count":103,"watchers_count":103,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":15,"forks":8,"open_issues":15,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/radix/effect/pulls/47"},"html":{"href":"https://github.com/radix/effect/pull/47"},"issue":{"href":"https://api.github.com/repos/radix/effect/issues/47"},"comments":{"href":"https://api.github.com/repos/radix/effect/issues/47/comments"},"review_comments":{"href":"https://api.github.com/repos/radix/effect/pulls/47/comments"},"review_comment":{"href":"https://api.github.com/repos/radix/effect/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/radix/effect/pulls/47/commits"},"statuses":{"href":"https://api.github.com/repos/radix/effect/statuses/a9d9f3cdbe51b9b56804554ef144b84b04b9337d"}}}}