repo.or.cz
/
rainbows.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
rainbows: set and use process-wide ENV["RACK_ENV"]
[rainbows.git]
/
t
/
sleep.ru
blob
9e4eff1d1c29bf8c70ddf3dd12fec369896c2590
1
use Rack::ContentLength
2
3
run lambda { |env|
4
/\A100-continue\z/i =~ env['HTTP_EXPECT'] and return [ 100, {}, [] ]
5
6
env['rack.input'].read
7
nr = 1
8
env["PATH_INFO"] =~ %r{/([\d\.]+)\z} and nr = $1.to_f
9
10
(case env['rainbows.model']
11
when :Revactor
12
Actor
13
else
14
Kernel
15
end).sleep(nr)
16
17
[ 200, {'Content-Type' => 'text/plain'}, [ "Hello\n" ] ]
18
}