{"action":"created","issue":{"url":"https://api.github.com/repos/google/go-cloud/issues/753","repository_url":"https://api.github.com/repos/google/go-cloud","labels_url":"https://api.github.com/repos/google/go-cloud/issues/753/labels{/name}","comments_url":"https://api.github.com/repos/google/go-cloud/issues/753/comments","events_url":"https://api.github.com/repos/google/go-cloud/issues/753/events","html_url":"https://github.com/google/go-cloud/issues/753","id":382225988,"node_id":"MDU6SXNzdWUzODIyMjU5ODg=","number":753,"title":"pubsub: clarify the purpose of driver Close methods","user":{"login":"jba","id":18483045,"node_id":"MDQ6VXNlcjE4NDgzMDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/18483045?v=4","gravatar_id":"","url":"https://api.github.com/users/jba","html_url":"https://github.com/jba","followers_url":"https://api.github.com/users/jba/followers","following_url":"https://api.github.com/users/jba/following{/other_user}","gists_url":"https://api.github.com/users/jba/gists{/gist_id}","starred_url":"https://api.github.com/users/jba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jba/subscriptions","organizations_url":"https://api.github.com/users/jba/orgs","repos_url":"https://api.github.com/users/jba/repos","events_url":"https://api.github.com/users/jba/events{/privacy}","received_events_url":"https://api.github.com/users/jba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"jba","id":18483045,"node_id":"MDQ6VXNlcjE4NDgzMDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/18483045?v=4","gravatar_id":"","url":"https://api.github.com/users/jba","html_url":"https://github.com/jba","followers_url":"https://api.github.com/users/jba/followers","following_url":"https://api.github.com/users/jba/following{/other_user}","gists_url":"https://api.github.com/users/jba/gists{/gist_id}","starred_url":"https://api.github.com/users/jba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jba/subscriptions","organizations_url":"https://api.github.com/users/jba/orgs","repos_url":"https://api.github.com/users/jba/repos","events_url":"https://api.github.com/users/jba/events{/privacy}","received_events_url":"https://api.github.com/users/jba/received_events","type":"User","site_admin":false},"assignees":[{"login":"jba","id":18483045,"node_id":"MDQ6VXNlcjE4NDgzMDQ1","avatar_url":"https://avatars1.githubusercontent.com/u/18483045?v=4","gravatar_id":"","url":"https://api.github.com/users/jba","html_url":"https://github.com/jba","followers_url":"https://api.github.com/users/jba/followers","following_url":"https://api.github.com/users/jba/following{/other_user}","gists_url":"https://api.github.com/users/jba/gists{/gist_id}","starred_url":"https://api.github.com/users/jba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jba/subscriptions","organizations_url":"https://api.github.com/users/jba/orgs","repos_url":"https://api.github.com/users/jba/repos","events_url":"https://api.github.com/users/jba/events{/privacy}","received_events_url":"https://api.github.com/users/jba/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2018-11-19T13:56:30Z","updated_at":"2018-11-19T20:44:41Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"It's unclear what the driver package's `Topic.Close` and `Subscription.Close` methods should do. \r\n\r\nWe suggest that Topics and Subscriptions be created via `OpenXXX` methods which take some sort of closeable, connection-oriented value like a client or a gRPC `ClientConn`. Since the caller establishes the connection, they should be responsible for closing it. Also, they may want to reuse the connection for multiple Topics and Subscriptions. If `Topic.Close` closed the connection, that would invalidate all the other opened Topics. The alternative would be to reference-count the connections so only unused ones were closed. That would add a lot of complexity to the driver, and we want to keep them as simple as we can.\r\n\r\nIf the `Close` methods don't close the connection, it's not clear what is left for them to do. I suppose some driver implementation might have a client-side per-topic or per-subscription resource that they want to clean up (perhaps background goroutines), so we can leave the `Close` methods there and document their purpose. Or we could just remove them.\r\n\r\nIf a driver implemented a `Client` type with `OpenTopic`, `OpenSubscription` and `Close` methods, it probably wouldn't need `Topic.Close` or `Subscription.Close`. See #679."},"comment":{"url":"https://api.github.com/repos/google/go-cloud/issues/comments/440035553","html_url":"https://github.com/google/go-cloud/issues/753#issuecomment-440035553","issue_url":"https://api.github.com/repos/google/go-cloud/issues/753","id":440035553,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MDAzNTU1Mw==","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},"created_at":"2018-11-19T20:44:41Z","updated_at":"2018-11-19T20:44:41Z","author_association":"CONTRIBUTOR","body":"Also, they seem equally straightforward to me, with the cleanup function having the advantage that it's obvious if you're not doing it."}}
{"actor":{"display_login":"ijt"}}