Class: ControlTower::Server
- Inherits:
-
Object
- Object
- ControlTower::Server
- Defined in:
- lib/control_tower/server.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
Instance Method Summary collapse
-
#initialize(app, options) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
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, ) @app = app () @socket = RackSocket.new(@host, @port, self, @concurrent) end |
Instance Attribute Details
#app ⇒ Object (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
#start ⇒ Object
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 |