{"action":"created","comment":{"url":"https://api.github.com/repos/google/go-cloud/pulls/comments/232524145","pull_request_review_id":173738055,"id":232524145,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMjUyNDE0NQ==","diff_hunk":"@@ -0,0 +1,272 @@\n+// Copyright 2018 The Go Cloud Authors\n+//\n+// Licensed under the Apache License, Version 2.0 (the \"License\");\n+// you may not use this file except in compliance with the License.\n+// You may obtain a copy of the License at\n+//\n+//     https://www.apache.org/licenses/LICENSE-2.0\n+//\n+// Unless required by applicable law or agreed to in writing, software\n+// distributed under the License is distributed on an \"AS IS\" BASIS,\n+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+// See the License for the specific language governing permissions and\n+// limitations under the License.\n+package pubsub\n+\n+import (\n+\t\"context\"\n+\t\"errors\"\n+\t\"time\"\n+\n+\t\"github.com/google/go-cloud/pubsub/driver\"\n+\t\"google.golang.org/api/support/bundler\"\n+)\n+\n+// Message contains data to be published.\n+type Message struct {\n+\t// Body contains the content of the message.\n+\tBody []byte\n+\n+\t// Attributes has key/value metadata for the message.\n+\tAttributes map[string]string\n+\n+\t// AckID identifies the message on the server.\n+\t// It can be used to ack the message after it has been received.\n+\tackID AckID\n+\n+\t// sub is the Subscription this message was received from.\n+\tsub *Subscription\n+}\n+\n+// AckID identifies a message for acknowledgement.\n+type AckID interface{}\n+\n+// Ack acknowledges the message, telling the server that it does not need to\n+// be sent again to the associated Subscription. This method blocks until\n+// the message has been confirmed as acknowledged on the server, or failure\n+// occurs.\n+func (m *Message) Ack(ctx context.Context) error {\n+\t// Send the message back to the subscription for ack batching.\n+\tmec := msgErrChan{\n+\t\tmsg:     m,\n+\t\terrChan: make(chan error),\n+\t}\n+\tsize := 8\n+\tif err := m.sub.ackBatcher.AddWait(ctx, mec, size); err != nil {\n+\t\treturn err\n+\t}\n+\treturn <-mec.errChan\n+}\n+\n+type msgErrChan struct {\n+\tmsg     *Message\n+\terrChan chan error\n+}\n+\n+// Topic publishes messages to all its subscribers.\n+type Topic struct {\n+\tdriver  driver.Topic\n+\tbatcher *bundler.Bundler\n+}\n+\n+// TopicOptions contains configuration for Topics.\n+type TopicOptions struct {\n+\t// SendDelay tells the max duration to wait before sending the next batch of\n+\t// messages to the server.\n+\tSendDelay time.Duration\n+\n+\t// BatchSize specifies the maximum number of messages that can go in a batch\n+\t// for sending.\n+\tBatchSize int\n+}\n+\n+// SendDelayDefault is the value for TopicOptions.SendDelay if it is not set.\n+const SendDelayDefault = time.Millisecond\n+\n+var DefaultTopicOptions = TopicOptions{","path":"pubsub/pubsub.go","position":84,"original_position":86,"commit_id":"055d4600b8b5ab4fc414756d243380e627cfd99f","original_commit_id":"6742f57ca8318ebdc5eb99711f680a1d17c18697","user":{"login":"ijt","id":15530,"node_id":"MDQ6VXNlcjE1NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/15530?v=4","gravatar_id":"","url":"https://api.github.com/users/ijt","html_url":"https://github.com/ijt","followers_url":"https://api.github.com/users/ijt/followers","following_url":"https://api.github.com/users/ijt/following{/other_user}","gists_url":"https://api.github.com/users/ijt/gists{/gist_id}","starred_url":"https://api.github.com/users/ijt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijt/subscriptions","organizations_url":"https://api.github.com/users/ijt/orgs","repos_url":"https://api.github.com/users/ijt/repos","events_url":"https://api.github.com/users/ijt/events{/privacy}","received_events_url":"https://api.github.com/users/ijt/received_events","type":"User","site_admin":false},"body":"That's what I had before but @jba wanted to have nil denote the default.\r\nAnyway, it will be moot if we do https://github.com/google/go-cloud/issues/665.","created_at":"2018-11-12T02:57:30Z","updated_at":"2018-11-12T02:58:21Z","html_url":"https://github.com/google/go-cloud/pull/642#discussion_r232524145","pull_request_url":"https://api.github.com/repos/google/go-cloud/pulls/642","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/google/go-cloud/pulls/comments/232524145"},"html":{"href":"https://github.com/google/go-cloud/pull/642#discussion_r232524145"},"pull_request":{"href":"https://api.github.com/repos/google/go-cloud/pulls/642"}},"in_reply_to_id":232388900},"pull_request":{"url":"https://api.github.com/repos/google/go-cloud/pulls/642","id":228875768,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI4ODc1NzY4","html_url":"https://github.com/google/go-cloud/pull/642","diff_url":"https://github.com/google/go-cloud/pull/642.diff","patch_url":"https://github.com/google/go-cloud/pull/642.patch","issue_url":"https://api.github.com/repos/google/go-cloud/issues/642","number":642,"state":"open","locked":false,"title":"pubsub: add concrete API implementation","user":{"login":"ijt","id":15530,"node_id":"MDQ6VXNlcjE1NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/15530?v=4","gravatar_id":"","url":"https://api.github.com/users/ijt","html_url":"https://github.com/ijt","followers_url":"https://api.github.com/users/ijt/followers","following_url":"https://api.github.com/users/ijt/following{/other_user}","gists_url":"https://api.github.com/users/ijt/gists{/gist_id}","starred_url":"https://api.github.com/users/ijt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijt/subscriptions","organizations_url":"https://api.github.com/users/ijt/orgs","repos_url":"https://api.github.com/users/ijt/repos","events_url":"https://api.github.com/users/ijt/events{/privacy}","received_events_url":"https://api.github.com/users/ijt/received_events","type":"User","site_admin":false},"body":"Fixes #607 ","created_at":"2018-11-07T00:00:56Z","updated_at":"2018-11-12T02:58:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"273d4848b4e83145612309011f36ba5993820391","assignee":{"login":"vangent","id":22553934,"node_id":"MDQ6VXNlcjIyNTUzOTM0","avatar_url":"https://avatars3.githubusercontent.com/u/22553934?v=4","gravatar_id":"","url":"https://api.github.com/users/vangent","html_url":"https://github.com/vangent","followers_url":"https://api.github.com/users/vangent/followers","following_url":"https://api.github.com/users/vangent/following{/other_user}","gists_url":"https://api.github.com/users/vangent/gists{/gist_id}","starred_url":"https://api.github.com/users/vangent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vangent/subscriptions","organizations_url":"https://api.github.com/users/vangent/orgs","repos_url":"https://api.github.com/users/vangent/repos","events_url":"https://api.github.com/users/vangent/events{/privacy}","received_events_url":"https://api.github.com/users/vangent/received_events","type":"User","site_admin":false},"assignees":[{"login":"zombiezen","id":181535,"node_id":"MDQ6VXNlcjE4MTUzNQ==","avatar_url":"https://avatars2.githubusercontent.com/u/181535?v=4","gravatar_id":"","url":"https://api.github.com/users/zombiezen","html_url":"https://github.com/zombiezen","followers_url":"https://api.github.com/users/zombiezen/followers","following_url":"https://api.github.com/users/zombiezen/following{/other_user}","gists_url":"https://api.github.com/users/zombiezen/gists{/gist_id}","starred_url":"https://api.github.com/users/zombiezen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zombiezen/subscriptions","organizations_url":"https://api.github.com/users/zombiezen/orgs","repos_url":"https://api.github.com/users/zombiezen/repos","events_url":"https://api.github.com/users/zombiezen/events{/privacy}","received_events_url":"https://api.github.com/users/zombiezen/received_events","type":"User","site_admin":false},{"login":"vangent","id":22553934,"node_id":"MDQ6VXNlcjIyNTUzOTM0","avatar_url":"https://avatars3.githubusercontent.com/u/22553934?v=4","gravatar_id":"","url":"https://api.github.com/users/vangent","html_url":"https://github.com/vangent","followers_url":"https://api.github.com/users/vangent/followers","following_url":"https://api.github.com/users/vangent/following{/other_user}","gists_url":"https://api.github.com/users/vangent/gists{/gist_id}","starred_url":"https://api.github.com/users/vangent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vangent/subscriptions","organizations_url":"https://api.github.com/users/vangent/orgs","repos_url":"https://api.github.com/users/vangent/repos","events_url":"https://api.github.com/users/vangent/events{/privacy}","received_events_url":"https://api.github.com/users/vangent/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1016532751,"node_id":"MDU6TGFiZWwxMDE2NTMyNzUx","url":"https://api.github.com/repos/google/go-cloud/labels/cla:%20yes","name":"cla: yes","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/google/go-cloud/pulls/642/commits","review_comments_url":"https://api.github.com/repos/google/go-cloud/pulls/642/comments","review_comment_url":"https://api.github.com/repos/google/go-cloud/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/go-cloud/issues/642/comments","statuses_url":"https://api.github.com/repos/google/go-cloud/statuses/055d4600b8b5ab4fc414756d243380e627cfd99f","head":{"label":"ijt:pubsub20181101","ref":"pubsub20181101","sha":"055d4600b8b5ab4fc414756d243380e627cfd99f","user":{"login":"ijt","id":15530,"node_id":"MDQ6VXNlcjE1NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/15530?v=4","gravatar_id":"","url":"https://api.github.com/users/ijt","html_url":"https://github.com/ijt","followers_url":"https://api.github.com/users/ijt/followers","following_url":"https://api.github.com/users/ijt/following{/other_user}","gists_url":"https://api.github.com/users/ijt/gists{/gist_id}","starred_url":"https://api.github.com/users/ijt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijt/subscriptions","organizations_url":"https://api.github.com/users/ijt/orgs","repos_url":"https://api.github.com/users/ijt/repos","events_url":"https://api.github.com/users/ijt/events{/privacy}","received_events_url":"https://api.github.com/users/ijt/received_events","type":"User","site_admin":false},"repo":{"id":142936626,"node_id":"MDEwOlJlcG9zaXRvcnkxNDI5MzY2MjY=","name":"go-cloud","full_name":"ijt/go-cloud","private":false,"owner":{"login":"ijt","id":15530,"node_id":"MDQ6VXNlcjE1NTMw","avatar_url":"https://avatars0.githubusercontent.com/u/15530?v=4","gravatar_id":"","url":"https://api.github.com/users/ijt","html_url":"https://github.com/ijt","followers_url":"https://api.github.com/users/ijt/followers","following_url":"https://api.github.com/users/ijt/following{/other_user}","gists_url":"https://api.github.com/users/ijt/gists{/gist_id}","starred_url":"https://api.github.com/users/ijt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ijt/subscriptions","organizations_url":"https://api.github.com/users/ijt/orgs","repos_url":"https://api.github.com/users/ijt/repos","events_url":"https://api.github.com/users/ijt/events{/privacy}","received_events_url":"https://api.github.com/users/ijt/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ijt/go-cloud","description":"A library and tools for open cloud development in Go.","fork":true,"url":"https://api.github.com/repos/ijt/go-cloud","forks_url":"https://api.github.com/repos/ijt/go-cloud/forks","keys_url":"https://api.github.com/repos/ijt/go-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ijt/go-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ijt/go-cloud/teams","hooks_url":"https://api.github.com/repos/ijt/go-cloud/hooks","issue_events_url":"https://api.github.com/repos/ijt/go-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/ijt/go-cloud/events","assignees_url":"https://api.github.com/repos/ijt/go-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/ijt/go-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/ijt/go-cloud/tags","blobs_url":"https://api.github.com/repos/ijt/go-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ijt/go-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ijt/go-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/ijt/go-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ijt/go-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/ijt/go-cloud/languages","stargazers_url":"https://api.github.com/repos/ijt/go-cloud/stargazers","contributors_url":"https://api.github.com/repos/ijt/go-cloud/contributors","subscribers_url":"https://api.github.com/repos/ijt/go-cloud/subscribers","subscription_url":"https://api.github.com/repos/ijt/go-cloud/subscription","commits_url":"https://api.github.com/repos/ijt/go-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/ijt/go-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/ijt/go-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/ijt/go-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/ijt/go-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/ijt/go-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ijt/go-cloud/merges","archive_url":"https://api.github.com/repos/ijt/go-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ijt/go-cloud/downloads","issues_url":"https://api.github.com/repos/ijt/go-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/ijt/go-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/ijt/go-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/ijt/go-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ijt/go-cloud/labels{/name}","releases_url":"https://api.github.com/repos/ijt/go-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/ijt/go-cloud/deployments","created_at":"2018-07-30T23:02:52Z","updated_at":"2018-07-31T00:27:06Z","pushed_at":"2018-11-12T02:50:15Z","git_url":"git://github.com/ijt/go-cloud.git","ssh_url":"git@github.com:ijt/go-cloud.git","clone_url":"https://github.com/ijt/go-cloud.git","svn_url":"https://github.com/ijt/go-cloud","homepage":"https://godoc.org/github.com/google/go-cloud","size":18811,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"ff635cc4c75ce4ca1547f68c4b0e95928c4a2872","user":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":126250425,"node_id":"MDEwOlJlcG9zaXRvcnkxMjYyNTA0MjU=","name":"go-cloud","full_name":"google/go-cloud","private":false,"owner":{"login":"google","id":1342004,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNDIwMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1342004?v=4","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/google/go-cloud","description":"A library and tools for open cloud development in Go.","fork":false,"url":"https://api.github.com/repos/google/go-cloud","forks_url":"https://api.github.com/repos/google/go-cloud/forks","keys_url":"https://api.github.com/repos/google/go-cloud/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/go-cloud/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/go-cloud/teams","hooks_url":"https://api.github.com/repos/google/go-cloud/hooks","issue_events_url":"https://api.github.com/repos/google/go-cloud/issues/events{/number}","events_url":"https://api.github.com/repos/google/go-cloud/events","assignees_url":"https://api.github.com/repos/google/go-cloud/assignees{/user}","branches_url":"https://api.github.com/repos/google/go-cloud/branches{/branch}","tags_url":"https://api.github.com/repos/google/go-cloud/tags","blobs_url":"https://api.github.com/repos/google/go-cloud/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/go-cloud/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/go-cloud/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/go-cloud/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/go-cloud/statuses/{sha}","languages_url":"https://api.github.com/repos/google/go-cloud/languages","stargazers_url":"https://api.github.com/repos/google/go-cloud/stargazers","contributors_url":"https://api.github.com/repos/google/go-cloud/contributors","subscribers_url":"https://api.github.com/repos/google/go-cloud/subscribers","subscription_url":"https://api.github.com/repos/google/go-cloud/subscription","commits_url":"https://api.github.com/repos/google/go-cloud/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/go-cloud/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/go-cloud/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/go-cloud/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/go-cloud/contents/{+path}","compare_url":"https://api.github.com/repos/google/go-cloud/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/go-cloud/merges","archive_url":"https://api.github.com/repos/google/go-cloud/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/go-cloud/downloads","issues_url":"https://api.github.com/repos/google/go-cloud/issues{/number}","pulls_url":"https://api.github.com/repos/google/go-cloud/pulls{/number}","milestones_url":"https://api.github.com/repos/google/go-cloud/milestones{/number}","notifications_url":"https://api.github.com/repos/google/go-cloud/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/go-cloud/labels{/name}","releases_url":"https://api.github.com/repos/google/go-cloud/releases{/id}","deployments_url":"https://api.github.com/repos/google/go-cloud/deployments","created_at":"2018-03-21T22:57:26Z","updated_at":"2018-11-12T02:09:17Z","pushed_at":"2018-11-12T02:50:17Z","git_url":"git://github.com/google/go-cloud.git","ssh_url":"git@github.com:google/go-cloud.git","clone_url":"https://github.com/google/go-cloud.git","svn_url":"https://github.com/google/go-cloud","homepage":"https://godoc.org/github.com/google/go-cloud","size":18551,"stargazers_count":4952,"watchers_count":4952,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":271,"mirror_url":null,"archived":false,"open_issues_count":90,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":271,"open_issues":90,"watchers":4952,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/go-cloud/pulls/642"},"html":{"href":"https://github.com/google/go-cloud/pull/642"},"issue":{"href":"https://api.github.com/repos/google/go-cloud/issues/642"},"comments":{"href":"https://api.github.com/repos/google/go-cloud/issues/642/comments"},"review_comments":{"href":"https://api.github.com/repos/google/go-cloud/pulls/642/comments"},"review_comment":{"href":"https://api.github.com/repos/google/go-cloud/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/go-cloud/pulls/642/commits"},"statuses":{"href":"https://api.github.com/repos/google/go-cloud/statuses/055d4600b8b5ab4fc414756d243380e627cfd99f"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ijt"}}