about summary refs log tree commit homepage
path: root/t/async_sinatra.ru
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-26 01:57:56 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-26 02:26:22 -0700
commit8e9672d13ed07cc262894b4770c0b9c016359712 (patch)
treeaafa88a841ade6f076c46af19aa203b5bd8f5d26 /t/async_sinatra.ru
parent9248ead0ae16091ea0c362930391834c0f32891c (diff)
downloadrainbows-8e9672d13ed07cc262894b4770c0b9c016359712.tar.gz
This is should be compatible with how the Thin webserver
provides async callback support.

See http://github.com/raggi/async_sinatra for the details
Diffstat (limited to 't/async_sinatra.ru')
-rw-r--r--t/async_sinatra.ru13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/async_sinatra.ru b/t/async_sinatra.ru
new file mode 100644
index 0000000..94a24b1
--- /dev/null
+++ b/t/async_sinatra.ru
@@ -0,0 +1,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