Class: ControlTower::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/control_tower/server.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app, options) ⇒ Server

Returns a new instance of Server.



8
9
10
11
12
# File 'lib/control_tower/server.rb', line 8

def initialize(app, options)
  @app = app
  parse_options(options)
  @socket = RackSocket.new(@host, @port, self, @concurrent)
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



6
7
8
# File 'lib/control_tower/server.rb', line 6

def app
  @app
end

Instance Method Details

#startObject



14
15
16
17
18
19
20
21
22
# File 'lib/control_tower/server.rb', line 14

def start
  trap 'INT' do
    @socket.close
    exit
  end

  # Ok, let the server do it's thing
  @socket.open
end