Created
September 1, 2017 01:51
-
-
Save trappist/18f41932732c5546069a8e5f21972585 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def subscribe_to_ticker | |
@ticker_thread = Thread.new do | |
@ticker_connection = WampClient::Connection.new(uri: 'wss://api.poloniex.com', realm: 'realm1', verbose: false) | |
@ticker_connection.on_join do |session, details| | |
session.subscribe('ticker', method(:ticker_handler)) | |
end | |
@ticker_connection.on_disconnect do |reason| | |
puts "DISCONNECTED: #{reason}" | |
end | |
@ticker_connection.open | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment