Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
13 lines (12 sloc) 263 Bytes
class AnalyticsSSE < Sinatra::Base
include Sinatra::SSE
get '/' do
sse_stream do |out|
number = 0
EM.add_periodic_timer(2) do
number = 10 + rand(50)
out.push :event => 'FOOBAR', :data => number.to_s
end
end
end
end