Class Waves::Dispatchers::Base
In: lib/dispatchers/base.rb
Parent: Object

Waves::Dispatchers::Base provides the basic request processing structure for a Rack application. It creates a Waves request, determines whether to enclose the request processing in a mutex benchmarks it, logs it, and handles redirects. Derived classes need only process the request within the safe method, which must take a Waves::Request and return a Waves::Response.

Methods

call   deferred?  

Public Instance methods

As with any Rack application, a Waves dispatcher must provide a call method that takes an env hash.

[Source]

    # File lib/dispatchers/base.rb, line 35
35:       def call( env )
36:         response = if Waves.synchronize? or Waves.debug?
37:           Waves.synchronize { Waves.reload ; _call( env )  }
38:         else
39:           _call( env )
40:         end
41:       end

Called by event driven servers like thin and ebb. Returns true if the server should run the request in a separate thread.

[Source]

    # File lib/dispatchers/base.rb, line 45
45:       def deferred?( env ) ; Waves.config.resource.new( Waves::Request.new( env ) ).deferred? ; end

[Validate]