In Files

Parent

Methods

Class Index [+]

Quicksearch

Rack::Lock

Constants

FLAG

Public Class Methods

new(app, mutex = Mutex.new) click to toggle source
    # File lib/rack/lock.rb, line 8
 8:     def initialize(app, mutex = Mutex.new)
 9:       @app, @mutex = app, mutex
10:     end

Public Instance Methods

call(env) click to toggle source
    # File lib/rack/lock.rb, line 12
12:     def call(env)
13:       old, env[FLAG] = env[FLAG], false
14:       @mutex.lock
15:       response = @app.call(env)
16:       response[2] = BodyProxy.new(response[2]) { @mutex.unlock }
17:       response
18:     rescue Exception
19:       @mutex.unlock
20:       raise
21:     ensure
22:       env[FLAG] = old
23:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.