{"action":"created","comment":{"url":"https://api.github.com/repos/sensu/sensu-go/pulls/comments/173269575","pull_request_review_id":102432534,"id":173269575,"diff_hunk":"@@ -0,0 +1,39 @@\n+package types\n+\n+import \"context\"\n+\n+// Queue is the interface of a queue. Queue's methods are atomic\n+// and goroutine-safe.\n+type Queue interface {\n+\t// Enqueue adds a new item to the queue. It returns any error that\n+\t// was encountered in doing so, or if the context is cancelled.\n+\tEnqueue(ctx context.Context, value string) error\n+\n+\t// Dequeue gets an Item from the queue. It returns the Item and any\n+\t// error encountered, or if the context is cancelled.\n+\tDequeue(ctx context.Context) (*QueueItem, error)\n+}\n+\n+// QueueItem contains a Value and embeds AckNack.\n+type QueueItem struct {\n+\t// Value is the item's underlying value.","path":"types/queue.go","position":19,"original_position":19,"commit_id":"87b2ae6d59a669f6d858fc77aa63d32f2dc0ab30","original_commit_id":"29b4711658a224f4430360860f620b3f7b02806f","user":{"login":"echlebek","id":1633772,"avatar_url":"https://avatars0.githubusercontent.com/u/1633772?v=4","gravatar_id":"","url":"https://api.github.com/users/echlebek","html_url":"https://github.com/echlebek","followers_url":"https://api.github.com/users/echlebek/followers","following_url":"https://api.github.com/users/echlebek/following{/other_user}","gists_url":"https://api.github.com/users/echlebek/gists{/gist_id}","starred_url":"https://api.github.com/users/echlebek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echlebek/subscriptions","organizations_url":"https://api.github.com/users/echlebek/orgs","repos_url":"https://api.github.com/users/echlebek/repos","events_url":"https://api.github.com/users/echlebek/events{/privacy}","received_events_url":"https://api.github.com/users/echlebek/received_events","type":"User","site_admin":false},"body":"I could have done:\r\n\r\n```\r\ntype QueueItem interface {\r\n    Ack(context.Context) error\r\n    Nack(context.Context) error\r\n    Value() string\r\n}\r\n```\r\n\r\nWould that be preferable?","created_at":"2018-03-08T19:43:44Z","updated_at":"2018-03-08T19:43:44Z","html_url":"https://github.com/sensu/sensu-go/pull/1125#discussion_r173269575","pull_request_url":"https://api.github.com/repos/sensu/sensu-go/pulls/1125","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/comments/173269575"},"html":{"href":"https://github.com/sensu/sensu-go/pull/1125#discussion_r173269575"},"pull_request":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/1125"}},"in_reply_to_id":173021970},"pull_request":{"url":"https://api.github.com/repos/sensu/sensu-go/pulls/1125","id":173233734,"html_url":"https://github.com/sensu/sensu-go/pull/1125","diff_url":"https://github.com/sensu/sensu-go/pull/1125.diff","patch_url":"https://github.com/sensu/sensu-go/pull/1125.patch","issue_url":"https://api.github.com/repos/sensu/sensu-go/issues/1125","number":1125,"state":"open","locked":false,"title":"Refactor the store, queue and ring.","user":{"login":"echlebek","id":1633772,"avatar_url":"https://avatars0.githubusercontent.com/u/1633772?v=4","gravatar_id":"","url":"https://api.github.com/users/echlebek","html_url":"https://github.com/echlebek","followers_url":"https://api.github.com/users/echlebek/followers","following_url":"https://api.github.com/users/echlebek/following{/other_user}","gists_url":"https://api.github.com/users/echlebek/gists{/gist_id}","starred_url":"https://api.github.com/users/echlebek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/echlebek/subscriptions","organizations_url":"https://api.github.com/users/echlebek/orgs","repos_url":"https://api.github.com/users/echlebek/repos","events_url":"https://api.github.com/users/echlebek/events{/privacy}","received_events_url":"https://api.github.com/users/echlebek/received_events","type":"User","site_admin":false},"body":"## What is this change?\r\n\r\nThis is a significant refactoring that aims to accomplish several\r\nthings.\r\n\r\n* Don't combine the Store interface with Queue and Ring interfaces.\r\n\r\n* Ensure that Queue and Ring are decoupled and represented in the\r\ntypes package.\r\n\r\n* Provide mock and fake implementations of Queue and Ring.\r\n\r\n* Don't export internal state of various daemon types. Instead,\r\ncreate Newers that handle setting the daemons' internal state.\r\nThis is more idiomatic and also reduces the chance of needing to\r\nbreak the API, by having fewer symbols exported.\r\n\r\n* Use consistent terminology and APIs between queue and ring\r\npackages for getters.\r\n\r\n* Implement types.QueueItem, and have Queue implementations make\r\nuse of it.\r\n\r\nSigned-off-by: Eric Chlebek <eric@sensu.io>\r\n\r\n## Why is this change necessary?\r\n\r\nCloses #987 \r\n\r\nWith the beta milestone coming up, we need to solidify the API so that it does not break in the future. This change pushes us towards that by reducing API surface, and decoupling some interfaces.\r\n\r\n## Does your change need a Changelog entry?\r\n\r\nYes","created_at":"2018-03-06T17:50:41Z","updated_at":"2018-03-08T19:43:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7802e383bc0c6f802afd7814754e05d328548706","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":658326752,"url":"https://api.github.com/repos/sensu/sensu-go/labels/ready-for-review","name":"ready-for-review","color":"ff8800","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/sensu/sensu-go/pulls/1125/commits","review_comments_url":"https://api.github.com/repos/sensu/sensu-go/pulls/1125/comments","review_comment_url":"https://api.github.com/repos/sensu/sensu-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sensu/sensu-go/issues/1125/comments","statuses_url":"https://api.github.com/repos/sensu/sensu-go/statuses/87b2ae6d59a669f6d858fc77aa63d32f2dc0ab30","head":{"label":"sensu:refactor/etcd-client","ref":"refactor/etcd-client","sha":"87b2ae6d59a669f6d858fc77aa63d32f2dc0ab30","user":{"login":"sensu","id":1648901,"avatar_url":"https://avatars2.githubusercontent.com/u/1648901?v=4","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"repo":{"id":82981995,"name":"sensu-go","full_name":"sensu/sensu-go","owner":{"login":"sensu","id":1648901,"avatar_url":"https://avatars2.githubusercontent.com/u/1648901?v=4","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensu/sensu-go","description":"The next generation of the Sensu you know and love. We'd love having you involved ❤","fork":false,"url":"https://api.github.com/repos/sensu/sensu-go","forks_url":"https://api.github.com/repos/sensu/sensu-go/forks","keys_url":"https://api.github.com/repos/sensu/sensu-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensu/sensu-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensu/sensu-go/teams","hooks_url":"https://api.github.com/repos/sensu/sensu-go/hooks","issue_events_url":"https://api.github.com/repos/sensu/sensu-go/issues/events{/number}","events_url":"https://api.github.com/repos/sensu/sensu-go/events","assignees_url":"https://api.github.com/repos/sensu/sensu-go/assignees{/user}","branches_url":"https://api.github.com/repos/sensu/sensu-go/branches{/branch}","tags_url":"https://api.github.com/repos/sensu/sensu-go/tags","blobs_url":"https://api.github.com/repos/sensu/sensu-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensu/sensu-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensu/sensu-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensu/sensu-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensu/sensu-go/statuses/{sha}","languages_url":"https://api.github.com/repos/sensu/sensu-go/languages","stargazers_url":"https://api.github.com/repos/sensu/sensu-go/stargazers","contributors_url":"https://api.github.com/repos/sensu/sensu-go/contributors","subscribers_url":"https://api.github.com/repos/sensu/sensu-go/subscribers","subscription_url":"https://api.github.com/repos/sensu/sensu-go/subscription","commits_url":"https://api.github.com/repos/sensu/sensu-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensu/sensu-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensu/sensu-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensu/sensu-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/sensu/sensu-go/contents/{+path}","compare_url":"https://api.github.com/repos/sensu/sensu-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensu/sensu-go/merges","archive_url":"https://api.github.com/repos/sensu/sensu-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensu/sensu-go/downloads","issues_url":"https://api.github.com/repos/sensu/sensu-go/issues{/number}","pulls_url":"https://api.github.com/repos/sensu/sensu-go/pulls{/number}","milestones_url":"https://api.github.com/repos/sensu/sensu-go/milestones{/number}","notifications_url":"https://api.github.com/repos/sensu/sensu-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensu/sensu-go/labels{/name}","releases_url":"https://api.github.com/repos/sensu/sensu-go/releases{/id}","deployments_url":"https://api.github.com/repos/sensu/sensu-go/deployments","created_at":"2017-02-23T23:38:08Z","updated_at":"2018-03-08T19:35:57Z","pushed_at":"2018-03-08T19:41:27Z","git_url":"git://github.com/sensu/sensu-go.git","ssh_url":"git@github.com:sensu/sensu-go.git","clone_url":"https://github.com/sensu/sensu-go.git","svn_url":"https://github.com/sensu/sensu-go","homepage":"","size":28908,"stargazers_count":103,"watchers_count":103,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":161,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":10,"open_issues":161,"watchers":103,"default_branch":"master"}},"base":{"label":"sensu:master","ref":"master","sha":"a7226b788984edb99b0a539a2467646d5550c05c","user":{"login":"sensu","id":1648901,"avatar_url":"https://avatars2.githubusercontent.com/u/1648901?v=4","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"repo":{"id":82981995,"name":"sensu-go","full_name":"sensu/sensu-go","owner":{"login":"sensu","id":1648901,"avatar_url":"https://avatars2.githubusercontent.com/u/1648901?v=4","gravatar_id":"","url":"https://api.github.com/users/sensu","html_url":"https://github.com/sensu","followers_url":"https://api.github.com/users/sensu/followers","following_url":"https://api.github.com/users/sensu/following{/other_user}","gists_url":"https://api.github.com/users/sensu/gists{/gist_id}","starred_url":"https://api.github.com/users/sensu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sensu/subscriptions","organizations_url":"https://api.github.com/users/sensu/orgs","repos_url":"https://api.github.com/users/sensu/repos","events_url":"https://api.github.com/users/sensu/events{/privacy}","received_events_url":"https://api.github.com/users/sensu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sensu/sensu-go","description":"The next generation of the Sensu you know and love. We'd love having you involved ❤","fork":false,"url":"https://api.github.com/repos/sensu/sensu-go","forks_url":"https://api.github.com/repos/sensu/sensu-go/forks","keys_url":"https://api.github.com/repos/sensu/sensu-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sensu/sensu-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sensu/sensu-go/teams","hooks_url":"https://api.github.com/repos/sensu/sensu-go/hooks","issue_events_url":"https://api.github.com/repos/sensu/sensu-go/issues/events{/number}","events_url":"https://api.github.com/repos/sensu/sensu-go/events","assignees_url":"https://api.github.com/repos/sensu/sensu-go/assignees{/user}","branches_url":"https://api.github.com/repos/sensu/sensu-go/branches{/branch}","tags_url":"https://api.github.com/repos/sensu/sensu-go/tags","blobs_url":"https://api.github.com/repos/sensu/sensu-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sensu/sensu-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sensu/sensu-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/sensu/sensu-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sensu/sensu-go/statuses/{sha}","languages_url":"https://api.github.com/repos/sensu/sensu-go/languages","stargazers_url":"https://api.github.com/repos/sensu/sensu-go/stargazers","contributors_url":"https://api.github.com/repos/sensu/sensu-go/contributors","subscribers_url":"https://api.github.com/repos/sensu/sensu-go/subscribers","subscription_url":"https://api.github.com/repos/sensu/sensu-go/subscription","commits_url":"https://api.github.com/repos/sensu/sensu-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/sensu/sensu-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/sensu/sensu-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/sensu/sensu-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/sensu/sensu-go/contents/{+path}","compare_url":"https://api.github.com/repos/sensu/sensu-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sensu/sensu-go/merges","archive_url":"https://api.github.com/repos/sensu/sensu-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sensu/sensu-go/downloads","issues_url":"https://api.github.com/repos/sensu/sensu-go/issues{/number}","pulls_url":"https://api.github.com/repos/sensu/sensu-go/pulls{/number}","milestones_url":"https://api.github.com/repos/sensu/sensu-go/milestones{/number}","notifications_url":"https://api.github.com/repos/sensu/sensu-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sensu/sensu-go/labels{/name}","releases_url":"https://api.github.com/repos/sensu/sensu-go/releases{/id}","deployments_url":"https://api.github.com/repos/sensu/sensu-go/deployments","created_at":"2017-02-23T23:38:08Z","updated_at":"2018-03-08T19:35:57Z","pushed_at":"2018-03-08T19:41:27Z","git_url":"git://github.com/sensu/sensu-go.git","ssh_url":"git@github.com:sensu/sensu-go.git","clone_url":"https://github.com/sensu/sensu-go.git","svn_url":"https://github.com/sensu/sensu-go","homepage":"","size":28908,"stargazers_count":103,"watchers_count":103,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":161,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":10,"open_issues":161,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/1125"},"html":{"href":"https://github.com/sensu/sensu-go/pull/1125"},"issue":{"href":"https://api.github.com/repos/sensu/sensu-go/issues/1125"},"comments":{"href":"https://api.github.com/repos/sensu/sensu-go/issues/1125/comments"},"review_comments":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/1125/comments"},"review_comment":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sensu/sensu-go/pulls/1125/commits"},"statuses":{"href":"https://api.github.com/repos/sensu/sensu-go/statuses/87b2ae6d59a669f6d858fc77aa63d32f2dc0ab30"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"echlebek"}}