{"action":"created","issue":{"url":"https://api.github.com/repos/google/go-cloud/issues/714","repository_url":"https://api.github.com/repos/google/go-cloud","labels_url":"https://api.github.com/repos/google/go-cloud/issues/714/labels{/name}","comments_url":"https://api.github.com/repos/google/go-cloud/issues/714/comments","events_url":"https://api.github.com/repos/google/go-cloud/issues/714/events","html_url":"https://github.com/google/go-cloud/issues/714","id":381282336,"node_id":"MDU6SXNzdWUzODEyODIzMzY=","number":714,"title":"mempubsub: OpenTopic and OpenSubscription should return concrete types","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},"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":0,"created_at":"2018-11-15T18:18:07Z","updated_at":"2018-11-15T18:29:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"See https://github.com/google/go-cloud/blob/ba6cdfb00c3d227ebaa0243978d0b9860b9f60e7/blob/fileblob/fileblob.go#L98 for a precedent.\r\n\r\nWe might decide to change how we're doing this, but if we do then it should be done consistently across all the Go Cloud packages."},"comment":{"url":"https://api.github.com/repos/google/go-cloud/issues/comments/439142765","html_url":"https://github.com/google/go-cloud/issues/714#issuecomment-439142765","issue_url":"https://api.github.com/repos/google/go-cloud/issues/714","id":439142765,"node_id":"MDEyOklzc3VlQ29tbWVudDQzOTE0Mjc2NQ==","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},"created_at":"2018-11-15T18:29:17Z","updated_at":"2018-11-15T18:29:17Z","author_association":"CONTRIBUTOR","body":"I started doing this, but ran into a problem.\r\n\r\n`OpenSubscription` takes a topic, which is the topic it subscribes to. The actual implementation adds the subscription to the topic's list of subscriptions:\r\n```\r\n   tt := t.(*topic) \r\n   ...\r\n   s := &subscription{\r\n        topic:       tt,\r\n        ackDeadline: ackDeadline,\r\n        msgs:        map[driver.AckID]*message{},\r\n        ctx:         ctx,\r\n        cancel:      cancel,\r\n    }\r\n    tt.mu.Lock()\r\n    defer tt.mu.Unlock()\r\n    tt.subs = append(tt.subs, s)\r\n```\r\nThis works when the `t` argument to `OpenSubscription` is a `driver.Topic`, because I can just assert it to my own implementation, as in the first line above. But if the arg is a `*pubsub.Topic`, I don't know what to do."}}
{"actor":{"display_login":"jba"}}