Created
December 3, 2014 08:10
-
-
Save jc00ke/0dc6f554a2c850f9bdce to your computer and use it in GitHub Desktop.
Angelo test
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
require "angelo" | |
$price ||= 0 | |
class App < Angelo::Base | |
websocket '/hearts' do |ws| | |
websockets[:hearts] << ws | |
ws.on_message do |msg| | |
$price += 1 | |
ws.write({ price: $price }.to_json) | |
end | |
end | |
end | |
App.run! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment