{"comment":{"url":"https://api.github.com/repos/ohler55/agoo/comments/28459561","html_url":"https://github.com/ohler55/agoo/commit/09d8a0455b63beded830f828f1fdba9ce0c08594#commitcomment-28459561","id":28459561,"user":{"login":"boazsegev","id":870622,"avatar_url":"https://avatars3.githubusercontent.com/u/870622?v=4","gravatar_id":"","url":"https://api.github.com/users/boazsegev","html_url":"https://github.com/boazsegev","followers_url":"https://api.github.com/users/boazsegev/followers","following_url":"https://api.github.com/users/boazsegev/following{/other_user}","gists_url":"https://api.github.com/users/boazsegev/gists{/gist_id}","starred_url":"https://api.github.com/users/boazsegev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boazsegev/subscriptions","organizations_url":"https://api.github.com/users/boazsegev/orgs","repos_url":"https://api.github.com/users/boazsegev/repos","events_url":"https://api.github.com/users/boazsegev/events{/privacy}","received_events_url":"https://api.github.com/users/boazsegev/received_events","type":"User","site_admin":false},"position":7,"line":7,"path":"misc/glue.md","commit_id":"09d8a0455b63beded830f828f1fdba9ce0c08594","created_at":"2018-04-06T20:47:52Z","updated_at":"2018-04-06T20:47:52Z","author_association":"NONE","body":"I'm not sure Ruby objects and connections are always separate things.\r\n\r\nConsider a Push connection just opened and it looks something like this:\r\n\r\n```ruby\r\ndef on_open\r\n\t@subscriptions = {}\r\n\t@subscriptions[\"users.#{@user.id}.notifications\"] = subscribe(\"users.#{@user.id}.notifications\")\r\n\t@subscriptions[\"users.#{@user.id}.alerts\"] = subscribe(\"users.#{@user.id}.alerts\")\r\n\t# ... not my best code, but it's just for illustration\r\n\t@subscriptions[\"users.#{@user.id}.internal\"] = subscribe(\"users.#{@user.id}.internal\") do |ch, msg|\r\n\t\tmsg = JSON.parse msg\r\n\t\t@subscriptions[msg['unsubscribe']].close if msg['unsubscribe'] && @subscriptions[msg['unsubscribe']]\r\n\tend\r\nend\r\n```\r\n\r\nThe last subscription is obviously a local subscription (not a server subscription)... but it's coupled with a connection object and uses that object's specific bindings.\r\n\r\nThe subscription becomes meaningless the moment the connection is closed. Shouldn't it behave the same as other connection related subscriptions (i.e., close automatically when the connection is closed?).\r\n\r\n**Side Note:** Maybe you're right about an `unsubscribe` method, otherwise channel name Strings are likely to have more than one copy stored in memory (once stored by the pub/sub system and another by the connection)."}}
{"actor":{"display_login":"boazsegev"}}