summary refs log tree commit homepage
path: root/t/async_sinatra.ru
blob: 94a24b1203e222a21ae1bcff3fc4ba2289e7f2ef (plain)
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