Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

call callback when websocket is closed #41

Closed
wants to merge 2 commits into from

Conversation

tyage
Copy link

@tyage tyage commented Oct 15, 2015

Changed to call @callbacks[:close] when connection is closed.
How about it?

@@ -31,6 +31,11 @@ def start
end

ws.on :close do |event|
if !@callbacks[:close].nil?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@callbacks[:close].each { |c| c.call } unless @callbacks[:close].nil?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! that's better code!

aki017 added a commit that referenced this pull request Feb 10, 2017
@aki017 aki017 closed this May 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants