Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: a8c41a9a3b
Fetching contributors…

Cannot retrieve contributors at this time

19 lines (14 sloc) 0.381 kb
require 'rubygems'
require 'bundler'
Bundler.require
class Stream < Goliath::API
def on_close(env)
env.logger.info "Connection closed."
end
def response(env)
keepalive = EM.add_periodic_timer(1) do
env.stream_send("#{Time.now.strftime("%a, %e %b %Y %H:%M:%S")}\n")
end
[200, {'Content-Type' => 'text/plain'}, Goliath::Response::STREAMING]
end
end
Jump to Line
Something went wrong with that request. Please try again.