{"action":"opened","number":961,"pull_request":{"url":"https://api.github.com/repos/ethereum/py-evm/pulls/961","id":197369026,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MzY5MDI2","html_url":"https://github.com/ethereum/py-evm/pull/961","diff_url":"https://github.com/ethereum/py-evm/pull/961.diff","patch_url":"https://github.com/ethereum/py-evm/pull/961.patch","issue_url":"https://api.github.com/repos/ethereum/py-evm/issues/961","number":961,"state":"open","locked":false,"title":"Create MsgQueueExposer/MsgQueueSubscriber as generic pattern","user":{"login":"cburgdorf","id":521109,"node_id":"MDQ6VXNlcjUyMTEwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/521109?v=4","gravatar_id":"","url":"https://api.github.com/users/cburgdorf","html_url":"https://github.com/cburgdorf","followers_url":"https://api.github.com/users/cburgdorf/followers","following_url":"https://api.github.com/users/cburgdorf/following{/other_user}","gists_url":"https://api.github.com/users/cburgdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/cburgdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cburgdorf/subscriptions","organizations_url":"https://api.github.com/users/cburgdorf/orgs","repos_url":"https://api.github.com/users/cburgdorf/repos","events_url":"https://api.github.com/users/cburgdorf/events{/privacy}","received_events_url":"https://api.github.com/users/cburgdorf/received_events","type":"User","site_admin":false},"body":"### What was wrong?\r\n\r\nWe currently use `asyncio.Queue` as a mean to do async communication in our code base. The way we use that in the `PeerPool` is to implement a `PeerPoolSubscriber` class and have the `PeerPool` expose `subscribe` and `unsubscribe` methods.\r\n\r\nWe may need the same pattern in the tx pool and probably other places as well. (Depends if other areas of our code are interested in certain events of the tx pool)\r\n\r\n### How was it fixed?\r\n\r\nThis is still a wip but I extracted the reusable bits into generic `MsgQueueExposer` and `MsgQueueSubscriber` classes that can be reused.\r\n\r\nNotice that I'm not quite happy with the typing just yet because I would really like to get rid of the currently needed casts.\r\n\r\nAlso notice that I *think* if we want this pattern to be extracted, then I think it should live somewhere outside of this repo to be reusable in other places. Maybe put it in `eth_utils` idk.\r\n\r\n#### Cute Animal Picture\r\n\r\n![put a cute animal picture link inside the parentheses]()\r\n","created_at":"2018-06-26T10:07:35Z","updated_at":"2018-06-26T10:07:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ethereum/py-evm/pulls/961/commits","review_comments_url":"https://api.github.com/repos/ethereum/py-evm/pulls/961/comments","review_comment_url":"https://api.github.com/repos/ethereum/py-evm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ethereum/py-evm/issues/961/comments","statuses_url":"https://api.github.com/repos/ethereum/py-evm/statuses/715c294bacc2a4d970a46ecda97dc0c72d6541c4","head":{"label":"cburgdorf:christoph/refactor/generic-msg-queue","ref":"christoph/refactor/generic-msg-queue","sha":"715c294bacc2a4d970a46ecda97dc0c72d6541c4","user":{"login":"cburgdorf","id":521109,"node_id":"MDQ6VXNlcjUyMTEwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/521109?v=4","gravatar_id":"","url":"https://api.github.com/users/cburgdorf","html_url":"https://github.com/cburgdorf","followers_url":"https://api.github.com/users/cburgdorf/followers","following_url":"https://api.github.com/users/cburgdorf/following{/other_user}","gists_url":"https://api.github.com/users/cburgdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/cburgdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cburgdorf/subscriptions","organizations_url":"https://api.github.com/users/cburgdorf/orgs","repos_url":"https://api.github.com/users/cburgdorf/repos","events_url":"https://api.github.com/users/cburgdorf/events{/privacy}","received_events_url":"https://api.github.com/users/cburgdorf/received_events","type":"User","site_admin":false},"repo":{"id":122467896,"node_id":"MDEwOlJlcG9zaXRvcnkxMjI0Njc4OTY=","name":"py-evm","full_name":"cburgdorf/py-evm","owner":{"login":"cburgdorf","id":521109,"node_id":"MDQ6VXNlcjUyMTEwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/521109?v=4","gravatar_id":"","url":"https://api.github.com/users/cburgdorf","html_url":"https://github.com/cburgdorf","followers_url":"https://api.github.com/users/cburgdorf/followers","following_url":"https://api.github.com/users/cburgdorf/following{/other_user}","gists_url":"https://api.github.com/users/cburgdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/cburgdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cburgdorf/subscriptions","organizations_url":"https://api.github.com/users/cburgdorf/orgs","repos_url":"https://api.github.com/users/cburgdorf/repos","events_url":"https://api.github.com/users/cburgdorf/events{/privacy}","received_events_url":"https://api.github.com/users/cburgdorf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cburgdorf/py-evm","description":"A Python implementation of the Ethereum Virtual Machine","fork":true,"url":"https://api.github.com/repos/cburgdorf/py-evm","forks_url":"https://api.github.com/repos/cburgdorf/py-evm/forks","keys_url":"https://api.github.com/repos/cburgdorf/py-evm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cburgdorf/py-evm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cburgdorf/py-evm/teams","hooks_url":"https://api.github.com/repos/cburgdorf/py-evm/hooks","issue_events_url":"https://api.github.com/repos/cburgdorf/py-evm/issues/events{/number}","events_url":"https://api.github.com/repos/cburgdorf/py-evm/events","assignees_url":"https://api.github.com/repos/cburgdorf/py-evm/assignees{/user}","branches_url":"https://api.github.com/repos/cburgdorf/py-evm/branches{/branch}","tags_url":"https://api.github.com/repos/cburgdorf/py-evm/tags","blobs_url":"https://api.github.com/repos/cburgdorf/py-evm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cburgdorf/py-evm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cburgdorf/py-evm/git/refs{/sha}","trees_url":"https://api.github.com/repos/cburgdorf/py-evm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cburgdorf/py-evm/statuses/{sha}","languages_url":"https://api.github.com/repos/cburgdorf/py-evm/languages","stargazers_url":"https://api.github.com/repos/cburgdorf/py-evm/stargazers","contributors_url":"https://api.github.com/repos/cburgdorf/py-evm/contributors","subscribers_url":"https://api.github.com/repos/cburgdorf/py-evm/subscribers","subscription_url":"https://api.github.com/repos/cburgdorf/py-evm/subscription","commits_url":"https://api.github.com/repos/cburgdorf/py-evm/commits{/sha}","git_commits_url":"https://api.github.com/repos/cburgdorf/py-evm/git/commits{/sha}","comments_url":"https://api.github.com/repos/cburgdorf/py-evm/comments{/number}","issue_comment_url":"https://api.github.com/repos/cburgdorf/py-evm/issues/comments{/number}","contents_url":"https://api.github.com/repos/cburgdorf/py-evm/contents/{+path}","compare_url":"https://api.github.com/repos/cburgdorf/py-evm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cburgdorf/py-evm/merges","archive_url":"https://api.github.com/repos/cburgdorf/py-evm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cburgdorf/py-evm/downloads","issues_url":"https://api.github.com/repos/cburgdorf/py-evm/issues{/number}","pulls_url":"https://api.github.com/repos/cburgdorf/py-evm/pulls{/number}","milestones_url":"https://api.github.com/repos/cburgdorf/py-evm/milestones{/number}","notifications_url":"https://api.github.com/repos/cburgdorf/py-evm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cburgdorf/py-evm/labels{/name}","releases_url":"https://api.github.com/repos/cburgdorf/py-evm/releases{/id}","deployments_url":"https://api.github.com/repos/cburgdorf/py-evm/deployments","created_at":"2018-02-22T11:07:50Z","updated_at":"2018-03-28T15:01:32Z","pushed_at":"2018-06-26T10:01:21Z","git_url":"git://github.com/cburgdorf/py-evm.git","ssh_url":"git@github.com:cburgdorf/py-evm.git","clone_url":"https://github.com/cburgdorf/py-evm.git","svn_url":"https://github.com/cburgdorf/py-evm","homepage":"http://py-evm.readthedocs.io/en/latest/","size":4401,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ethereum:master","ref":"master","sha":"042cd4bc215d8567d560f43564dbee2aba5c970d","user":{"login":"ethereum","id":6250754,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNTA3NTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"repo":{"id":77478378,"node_id":"MDEwOlJlcG9zaXRvcnk3NzQ3ODM3OA==","name":"py-evm","full_name":"ethereum/py-evm","owner":{"login":"ethereum","id":6250754,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyNTA3NTQ=","avatar_url":"https://avatars3.githubusercontent.com/u/6250754?v=4","gravatar_id":"","url":"https://api.github.com/users/ethereum","html_url":"https://github.com/ethereum","followers_url":"https://api.github.com/users/ethereum/followers","following_url":"https://api.github.com/users/ethereum/following{/other_user}","gists_url":"https://api.github.com/users/ethereum/gists{/gist_id}","starred_url":"https://api.github.com/users/ethereum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethereum/subscriptions","organizations_url":"https://api.github.com/users/ethereum/orgs","repos_url":"https://api.github.com/users/ethereum/repos","events_url":"https://api.github.com/users/ethereum/events{/privacy}","received_events_url":"https://api.github.com/users/ethereum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ethereum/py-evm","description":"A Python implementation of the Ethereum Virtual Machine","fork":false,"url":"https://api.github.com/repos/ethereum/py-evm","forks_url":"https://api.github.com/repos/ethereum/py-evm/forks","keys_url":"https://api.github.com/repos/ethereum/py-evm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ethereum/py-evm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ethereum/py-evm/teams","hooks_url":"https://api.github.com/repos/ethereum/py-evm/hooks","issue_events_url":"https://api.github.com/repos/ethereum/py-evm/issues/events{/number}","events_url":"https://api.github.com/repos/ethereum/py-evm/events","assignees_url":"https://api.github.com/repos/ethereum/py-evm/assignees{/user}","branches_url":"https://api.github.com/repos/ethereum/py-evm/branches{/branch}","tags_url":"https://api.github.com/repos/ethereum/py-evm/tags","blobs_url":"https://api.github.com/repos/ethereum/py-evm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ethereum/py-evm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ethereum/py-evm/git/refs{/sha}","trees_url":"https://api.github.com/repos/ethereum/py-evm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ethereum/py-evm/statuses/{sha}","languages_url":"https://api.github.com/repos/ethereum/py-evm/languages","stargazers_url":"https://api.github.com/repos/ethereum/py-evm/stargazers","contributors_url":"https://api.github.com/repos/ethereum/py-evm/contributors","subscribers_url":"https://api.github.com/repos/ethereum/py-evm/subscribers","subscription_url":"https://api.github.com/repos/ethereum/py-evm/subscription","commits_url":"https://api.github.com/repos/ethereum/py-evm/commits{/sha}","git_commits_url":"https://api.github.com/repos/ethereum/py-evm/git/commits{/sha}","comments_url":"https://api.github.com/repos/ethereum/py-evm/comments{/number}","issue_comment_url":"https://api.github.com/repos/ethereum/py-evm/issues/comments{/number}","contents_url":"https://api.github.com/repos/ethereum/py-evm/contents/{+path}","compare_url":"https://api.github.com/repos/ethereum/py-evm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ethereum/py-evm/merges","archive_url":"https://api.github.com/repos/ethereum/py-evm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ethereum/py-evm/downloads","issues_url":"https://api.github.com/repos/ethereum/py-evm/issues{/number}","pulls_url":"https://api.github.com/repos/ethereum/py-evm/pulls{/number}","milestones_url":"https://api.github.com/repos/ethereum/py-evm/milestones{/number}","notifications_url":"https://api.github.com/repos/ethereum/py-evm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ethereum/py-evm/labels{/name}","releases_url":"https://api.github.com/repos/ethereum/py-evm/releases{/id}","deployments_url":"https://api.github.com/repos/ethereum/py-evm/deployments","created_at":"2016-12-27T19:36:00Z","updated_at":"2018-06-26T07:55:09Z","pushed_at":"2018-06-26T09:47:06Z","git_url":"git://github.com/ethereum/py-evm.git","ssh_url":"git@github.com:ethereum/py-evm.git","clone_url":"https://github.com/ethereum/py-evm.git","svn_url":"https://github.com/ethereum/py-evm","homepage":"http://py-evm.readthedocs.io/en/latest/","size":3980,"stargazers_count":517,"watchers_count":517,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":223,"mirror_url":null,"archived":false,"open_issues_count":115,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":223,"open_issues":115,"watchers":517,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ethereum/py-evm/pulls/961"},"html":{"href":"https://github.com/ethereum/py-evm/pull/961"},"issue":{"href":"https://api.github.com/repos/ethereum/py-evm/issues/961"},"comments":{"href":"https://api.github.com/repos/ethereum/py-evm/issues/961/comments"},"review_comments":{"href":"https://api.github.com/repos/ethereum/py-evm/pulls/961/comments"},"review_comment":{"href":"https://api.github.com/repos/ethereum/py-evm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ethereum/py-evm/pulls/961/commits"},"statuses":{"href":"https://api.github.com/repos/ethereum/py-evm/statuses/715c294bacc2a4d970a46ecda97dc0c72d6541c4"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":55,"deletions":22,"changed_files":2}}
{"actor":{"display_login":"cburgdorf"}}