Sha256: d1cb323c6a4497c5a28655d94c4c131593b15dec142d21cc3c25f51c3ada8808
Contents?: true
Size: 651 Bytes
Versions: 35
Compression:
Stored size: 651 Bytes
Contents
#\-E none # can't use non-compatible middleware that doesn't pass "deferered?" calls # # used for testing deferred actions for Merb and possibly other frameworks # ref: http://brainspl.at/articles/2008/04/18/deferred-requests-with-merb-ebb-and-thin class DeferredApp < Struct.new(:app) def deferred?(env) env["PATH_INFO"] == "/deferred" end def call(env) env["rack.multithread"] or raise RuntimeError, "rack.multithread not true" body = "#{Thread.current.inspect}\n" headers = { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s, } [ 200, headers, [ body ] ] end end run DeferredApp.new
Version data entries
35 entries across 35 versions & 1 rubygems