Skip to content

self is dropped in the callbacksΒ #21

@sergeych

Description

@sergeych

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
}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions