Class: Routemaster::Drain::Mapping

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/routemaster/drain/mapping.rb

Overview

Rack application which authenticates, parses, filters, pushes to a dirty map, and finally broadcasts events received from Routemaster.

The dirty map can be obtained, for further processing, using Dirty::Map.new.

See the various corresponding middleware for details on operation: Middleware::RootPostOnly, Middleware::Authenticate, Middleware::Parse, Middleware::Filter, Middleware::Dirty, and Terminator.

Instance Method Summary collapse

Methods included from Forwardable

_compile_method

Constructor Details

#initialize(options = {}) ⇒ Mapping

Returns a new instance of Mapping.



27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/routemaster/drain/mapping.rb', line 27

def initialize(options = {})
  @terminator = terminator = Terminator.new
  @app = ::Rack::Builder.new do
    use Middleware::RootPostOnly
    use Middleware::Authenticate, options
    use Middleware::Parse
    use Middleware::Siphon,       options
    use Middleware::Filter,       options
    use Middleware::Dirty,        options
    run terminator
  end
end