-
Notifications
You must be signed in to change notification settings - Fork 188
Memory leak trying to memoize websockets #136
Copy link
Copy link
Open
Description
I need to be able to publish data to specific websockets.
The full gist of it is: https://gist.github.com/AvnerCohen/72540e2dc13a56b4be87
Specifically I do something like:
ws.onmessage do |msg|
event_type, *data = msg.split(":")
if event_type == 'typing'
PublishMessage.do(WS_CLIENTS[data.first], "typing:#{data.last}")
elsif event_type == 'connected'
WS_CLIENTS_NAME_TO_SOCKET[ws.get_pid] = data.first
WS_CLIENTS[data.first] = ws
end
endand so, this line:
WS_CLIENTS[data.first] = wsSaves the websocket for later reference by username.
this is causing MRI to leak, no idea why, any alternative suggestion to overcome this?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels