2 # can't use non-compatible middleware that doesn't pass "deferered?" calls
4 # used for testing deferred actions for Merb and possibly other frameworks
5 # ref: http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin
7 class DeferredApp < Struct.new(:app)
9 env["PATH_INFO"] == "/deferred"
13 env["rack.multithread"] or raise RuntimeError, "rack.multithread not true"
14 body = "#{Thread.current.inspect}\n"
16 "Content-Type" => "text/plain",
17 "Content-Length" => body.size.to_s,
19 [ 200, headers, [ body ] ]