{"action":"opened","number":91,"pull_request":{"url":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91","id":30316210,"html_url":"https://github.com/NSLS-II/dataportal/pull/91","diff_url":"https://github.com/NSLS-II/dataportal/pull/91.diff","patch_url":"https://github.com/NSLS-II/dataportal/pull/91.patch","issue_url":"https://api.github.com/repos/NSLS-II/dataportal/issues/91","number":91,"state":"open","locked":false,"title":"Add EventQueue in broker for efficient extraction of live-updating data","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"body":"The EventQueue knows about a Header (or Headers) and it can query it for an updated full list of Events. It keeps tracks of which Events it has already seen, and it only gets the filestore payload once per Event.\r\n\r\nHere's an example of using an EventQueue with a DataMuxer to keep it up to date.\r\n\r\n```\r\nfrom dataportal.broker import DataBroker, EventQueue\r\nfrom dataportal.muxer import DataMuxer\r\n\r\ndm = DataMuxer()\r\nheader = DataBroker[-1]\r\nqueue = EventQueue(header)\r\nwhile True:\r\n    queue.update()\r\n    new_events = queue.pop()\r\n    dm.append_events(new_events)\r\n    # update a plot or something\r\n```\r\n\r\nThis PR includes a thorough test.","created_at":"2015-03-02T20:14:11Z","updated_at":"2015-03-02T20:14:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91/commits","review_comments_url":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91/comments","review_comment_url":"https://api.github.com/repos/NSLS-II/dataportal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/NSLS-II/dataportal/issues/91/comments","statuses_url":"https://api.github.com/repos/NSLS-II/dataportal/statuses/4668fe468fddef54f13444001aac887b9fad983a","head":{"label":"danielballan:queues","ref":"queues","sha":"4668fe468fddef54f13444001aac887b9fad983a","user":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"repo":{"id":28930175,"name":"dataportal","full_name":"danielballan/dataportal","owner":{"login":"danielballan","id":2279598,"avatar_url":"https://avatars.githubusercontent.com/u/2279598?v=3","gravatar_id":"","url":"https://api.github.com/users/danielballan","html_url":"https://github.com/danielballan","followers_url":"https://api.github.com/users/danielballan/followers","following_url":"https://api.github.com/users/danielballan/following{/other_user}","gists_url":"https://api.github.com/users/danielballan/gists{/gist_id}","starred_url":"https://api.github.com/users/danielballan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielballan/subscriptions","organizations_url":"https://api.github.com/users/danielballan/orgs","repos_url":"https://api.github.com/users/danielballan/repos","events_url":"https://api.github.com/users/danielballan/events{/privacy}","received_events_url":"https://api.github.com/users/danielballan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/danielballan/dataportal","description":"Externally facing API for data","fork":true,"url":"https://api.github.com/repos/danielballan/dataportal","forks_url":"https://api.github.com/repos/danielballan/dataportal/forks","keys_url":"https://api.github.com/repos/danielballan/dataportal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/danielballan/dataportal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/danielballan/dataportal/teams","hooks_url":"https://api.github.com/repos/danielballan/dataportal/hooks","issue_events_url":"https://api.github.com/repos/danielballan/dataportal/issues/events{/number}","events_url":"https://api.github.com/repos/danielballan/dataportal/events","assignees_url":"https://api.github.com/repos/danielballan/dataportal/assignees{/user}","branches_url":"https://api.github.com/repos/danielballan/dataportal/branches{/branch}","tags_url":"https://api.github.com/repos/danielballan/dataportal/tags","blobs_url":"https://api.github.com/repos/danielballan/dataportal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/danielballan/dataportal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/danielballan/dataportal/git/refs{/sha}","trees_url":"https://api.github.com/repos/danielballan/dataportal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/danielballan/dataportal/statuses/{sha}","languages_url":"https://api.github.com/repos/danielballan/dataportal/languages","stargazers_url":"https://api.github.com/repos/danielballan/dataportal/stargazers","contributors_url":"https://api.github.com/repos/danielballan/dataportal/contributors","subscribers_url":"https://api.github.com/repos/danielballan/dataportal/subscribers","subscription_url":"https://api.github.com/repos/danielballan/dataportal/subscription","commits_url":"https://api.github.com/repos/danielballan/dataportal/commits{/sha}","git_commits_url":"https://api.github.com/repos/danielballan/dataportal/git/commits{/sha}","comments_url":"https://api.github.com/repos/danielballan/dataportal/comments{/number}","issue_comment_url":"https://api.github.com/repos/danielballan/dataportal/issues/comments{/number}","contents_url":"https://api.github.com/repos/danielballan/dataportal/contents/{+path}","compare_url":"https://api.github.com/repos/danielballan/dataportal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/danielballan/dataportal/merges","archive_url":"https://api.github.com/repos/danielballan/dataportal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/danielballan/dataportal/downloads","issues_url":"https://api.github.com/repos/danielballan/dataportal/issues{/number}","pulls_url":"https://api.github.com/repos/danielballan/dataportal/pulls{/number}","milestones_url":"https://api.github.com/repos/danielballan/dataportal/milestones{/number}","notifications_url":"https://api.github.com/repos/danielballan/dataportal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/danielballan/dataportal/labels{/name}","releases_url":"https://api.github.com/repos/danielballan/dataportal/releases{/id}","created_at":"2015-01-07T19:30:49Z","updated_at":"2015-02-19T15:33:55Z","pushed_at":"2015-03-02T20:04:21Z","git_url":"git://github.com/danielballan/dataportal.git","ssh_url":"git@github.com:danielballan/dataportal.git","clone_url":"https://github.com/danielballan/dataportal.git","svn_url":"https://github.com/danielballan/dataportal","homepage":null,"size":1277,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"NSLS-II:master","ref":"master","sha":"4a2f66a7826e667c0e98c407e3551451dba78fdf","user":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"repo":{"id":24718080,"name":"dataportal","full_name":"NSLS-II/dataportal","owner":{"login":"NSLS-II","id":8700262,"avatar_url":"https://avatars.githubusercontent.com/u/8700262?v=3","gravatar_id":"","url":"https://api.github.com/users/NSLS-II","html_url":"https://github.com/NSLS-II","followers_url":"https://api.github.com/users/NSLS-II/followers","following_url":"https://api.github.com/users/NSLS-II/following{/other_user}","gists_url":"https://api.github.com/users/NSLS-II/gists{/gist_id}","starred_url":"https://api.github.com/users/NSLS-II/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NSLS-II/subscriptions","organizations_url":"https://api.github.com/users/NSLS-II/orgs","repos_url":"https://api.github.com/users/NSLS-II/repos","events_url":"https://api.github.com/users/NSLS-II/events{/privacy}","received_events_url":"https://api.github.com/users/NSLS-II/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/NSLS-II/dataportal","description":"Externally facing API for data","fork":false,"url":"https://api.github.com/repos/NSLS-II/dataportal","forks_url":"https://api.github.com/repos/NSLS-II/dataportal/forks","keys_url":"https://api.github.com/repos/NSLS-II/dataportal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/NSLS-II/dataportal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/NSLS-II/dataportal/teams","hooks_url":"https://api.github.com/repos/NSLS-II/dataportal/hooks","issue_events_url":"https://api.github.com/repos/NSLS-II/dataportal/issues/events{/number}","events_url":"https://api.github.com/repos/NSLS-II/dataportal/events","assignees_url":"https://api.github.com/repos/NSLS-II/dataportal/assignees{/user}","branches_url":"https://api.github.com/repos/NSLS-II/dataportal/branches{/branch}","tags_url":"https://api.github.com/repos/NSLS-II/dataportal/tags","blobs_url":"https://api.github.com/repos/NSLS-II/dataportal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/NSLS-II/dataportal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/NSLS-II/dataportal/git/refs{/sha}","trees_url":"https://api.github.com/repos/NSLS-II/dataportal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/NSLS-II/dataportal/statuses/{sha}","languages_url":"https://api.github.com/repos/NSLS-II/dataportal/languages","stargazers_url":"https://api.github.com/repos/NSLS-II/dataportal/stargazers","contributors_url":"https://api.github.com/repos/NSLS-II/dataportal/contributors","subscribers_url":"https://api.github.com/repos/NSLS-II/dataportal/subscribers","subscription_url":"https://api.github.com/repos/NSLS-II/dataportal/subscription","commits_url":"https://api.github.com/repos/NSLS-II/dataportal/commits{/sha}","git_commits_url":"https://api.github.com/repos/NSLS-II/dataportal/git/commits{/sha}","comments_url":"https://api.github.com/repos/NSLS-II/dataportal/comments{/number}","issue_comment_url":"https://api.github.com/repos/NSLS-II/dataportal/issues/comments{/number}","contents_url":"https://api.github.com/repos/NSLS-II/dataportal/contents/{+path}","compare_url":"https://api.github.com/repos/NSLS-II/dataportal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/NSLS-II/dataportal/merges","archive_url":"https://api.github.com/repos/NSLS-II/dataportal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/NSLS-II/dataportal/downloads","issues_url":"https://api.github.com/repos/NSLS-II/dataportal/issues{/number}","pulls_url":"https://api.github.com/repos/NSLS-II/dataportal/pulls{/number}","milestones_url":"https://api.github.com/repos/NSLS-II/dataportal/milestones{/number}","notifications_url":"https://api.github.com/repos/NSLS-II/dataportal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/NSLS-II/dataportal/labels{/name}","releases_url":"https://api.github.com/repos/NSLS-II/dataportal/releases{/id}","created_at":"2014-10-02T12:34:01Z","updated_at":"2015-03-02T18:04:42Z","pushed_at":"2015-03-02T19:35:58Z","git_url":"git://github.com/NSLS-II/dataportal.git","ssh_url":"git@github.com:NSLS-II/dataportal.git","clone_url":"https://github.com/NSLS-II/dataportal.git","svn_url":"https://github.com/NSLS-II/dataportal","homepage":"http://nsls-ii.github.io/","size":1906,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":19,"forks":4,"open_issues":19,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91"},"html":{"href":"https://github.com/NSLS-II/dataportal/pull/91"},"issue":{"href":"https://api.github.com/repos/NSLS-II/dataportal/issues/91"},"comments":{"href":"https://api.github.com/repos/NSLS-II/dataportal/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/NSLS-II/dataportal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/NSLS-II/dataportal/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/NSLS-II/dataportal/statuses/4668fe468fddef54f13444001aac887b9fad983a"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":118,"deletions":22,"changed_files":3}}