It is actually a bug in the eventemitter gem, and serious one. Event callbacks for the socket are called on the wrong context, set by the emitter. It took me several hours to trace. I suggest to fix emitter or refrain of using it.
Sample:
`
me = self
@ws = WebSocket::Client::Simple.connect(ws_url)
@ws.on(:open) {
if me != self
puts "\n\n\nSelf is set to wrong in the callback in #{RUBY_VERSION}\n\n\n"
end
}
`
It is actually a bug in the eventemitter gem, and serious one. Event callbacks for the socket are called on the wrong context, set by the emitter. It took me several hours to trace. I suggest to fix emitter or refrain of using it.
Sample:
`
me = self
@ws = WebSocket::Client::Simple.connect(ws_url)
@ws.on(:open) {
if me != self
puts "\n\n\nSelf is set to wrong in the callback in #{RUBY_VERSION}\n\n\n"
end
}
`