Class: MobME::Infrastructure::RPC::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/mobme/infrastructure/rpc/version.rb,
lib/mobme/infrastructure/rpc/runner.rb

Class Method Summary collapse

Class Method Details

.start(application, host, port, route) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/mobme/infrastructure/rpc/runner.rb', line 3

def self.start(application, host, port, route)
  begin
    require "thin"
  rescue LoadError
    puts "Thin must be installed to use the server, please add thin to your Gemfile"
    exit
  end

  Thin::Server.start(host, port) do
    # Since no logger is specified, this will log apache-style strings to STDERR for each request.
    use Rack::CommonLogger

    map route do
      run Adaptor.new(application)
    end
  end
end