rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob 94a24b1203e222a21ae1bcff3fc4ba2289e7f2ef 280 bytes (raw)
$ git show HEAD:t/async_sinatra.ru	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
 
# See http://github.com/raggi/async_sinatra
# gem install async_sinatra -v0.1.5
require 'sinatra/async'

class AsyncTest < Sinatra::Base
  register Sinatra::Async

  aget '/:n' do |n|
    EM.add_timer(n.to_i) { body { "delayed for #{n} seconds\n" } }
  end
end

run AsyncTest.new

git clone https://yhbt.net/rainbows.git