{"action":"created","issue":{"url":"https://api.github.com/repos/igrigorik/em-websocket/issues/136","labels_url":"https://api.github.com/repos/igrigorik/em-websocket/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/igrigorik/em-websocket/issues/136/comments","events_url":"https://api.github.com/repos/igrigorik/em-websocket/issues/136/events","html_url":"https://github.com/igrigorik/em-websocket/issues/136","id":59784874,"number":136,"title":"Memory leak trying to memaoize websockets","user":{"login":"AvnerCohen","id":1297254,"avatar_url":"https://avatars.githubusercontent.com/u/1297254?v=3","gravatar_id":"","url":"https://api.github.com/users/AvnerCohen","html_url":"https://github.com/AvnerCohen","followers_url":"https://api.github.com/users/AvnerCohen/followers","following_url":"https://api.github.com/users/AvnerCohen/following{/other_user}","gists_url":"https://api.github.com/users/AvnerCohen/gists{/gist_id}","starred_url":"https://api.github.com/users/AvnerCohen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AvnerCohen/subscriptions","organizations_url":"https://api.github.com/users/AvnerCohen/orgs","repos_url":"https://api.github.com/users/AvnerCohen/repos","events_url":"https://api.github.com/users/AvnerCohen/events{/privacy}","received_events_url":"https://api.github.com/users/AvnerCohen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-04T11:24:03Z","updated_at":"2015-03-04T19:37:34Z","closed_at":null,"body":"I need to be able to publish data to specific websockets.\r\nThe full gist of it is: https://gist.github.com/AvnerCohen/72540e2dc13a56b4be87\r\n\r\nSpecifically I do something like:\r\n\r\n````ruby\r\n  ws.onmessage do |msg|\r\n      event_type, *data = msg.split(\":\")\r\n      if event_type == 'typing'\r\n        PublishMessage.do(WS_CLIENTS[data.first], \"typing:#{data.last}\")\r\n        elsif event_type == 'connected'\r\n          WS_CLIENTS_NAME_TO_SOCKET[ws.get_pid] = data.first\r\n          WS_CLIENTS[data.first] = ws\r\n        end\r\n      end\r\n````\r\n\r\nand so, this line:\r\n````ruby\r\n          WS_CLIENTS[data.first] = ws\r\n````\r\n\r\nSaves the websocket for later reference by username.\r\n\r\n\r\nthis is causing MRI to leak, no idea why, any alternative suggestion to overcome this?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/igrigorik/em-websocket/issues/comments/77229804","html_url":"https://github.com/igrigorik/em-websocket/issues/136#issuecomment-77229804","issue_url":"https://api.github.com/repos/igrigorik/em-websocket/issues/136","id":77229804,"user":{"login":"JokerCatz","id":70926,"avatar_url":"https://avatars.githubusercontent.com/u/70926?v=3","gravatar_id":"","url":"https://api.github.com/users/JokerCatz","html_url":"https://github.com/JokerCatz","followers_url":"https://api.github.com/users/JokerCatz/followers","following_url":"https://api.github.com/users/JokerCatz/following{/other_user}","gists_url":"https://api.github.com/users/JokerCatz/gists{/gist_id}","starred_url":"https://api.github.com/users/JokerCatz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JokerCatz/subscriptions","organizations_url":"https://api.github.com/users/JokerCatz/orgs","repos_url":"https://api.github.com/users/JokerCatz/repos","events_url":"https://api.github.com/users/JokerCatz/events{/privacy}","received_events_url":"https://api.github.com/users/JokerCatz/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T19:37:34Z","updated_at":"2015-03-04T19:37:34Z","body":"hmm...I don't know why , & I fork em-websocket to support long-polling\r\nhttps://github.com/JokerCatz/em-websocket/tree/long_polling_support\r\ntry it again? , it okay for our production , just overwrite the em-connection :)"}}