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
test_isolate: prevent concurrent execution
[rainbows.git]
/
t
/
sleep.ru
blob
b57efc35c33c5c8f5e91f3e911e5f69df4acf3d0
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
Rainbows.sleep(nr)
11
12
[ 200, {'Content-Type' => 'text/plain'}, [ "Hello\n" ] ]
13
}