Class: Woodhouse::Server
- Inherits:
-
Object
- Object
- Woodhouse::Server
- Includes:
- Celluloid, Util
- Defined in:
- lib/woodhouse/server.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#layout ⇒ Object
Returns the value of attribute layout.
-
#node ⇒ Object
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(keyw = {}) ⇒ Server
constructor
A new instance of Server.
- #ready_to_start? ⇒ Boolean
- #reload ⇒ Object
-
#shutdown ⇒ Object
TODO: do this better.
- #start ⇒ Object
Constructor Details
#initialize(keyw = {}) ⇒ Server
Returns a new instance of Server.
12 13 14 15 16 |
# File 'lib/woodhouse/server.rb', line 12 def initialize(keyw = {}) self.layout = keyw[:layout] self.node = keyw[:node] self.configuration = keyw[:configuration] || Woodhouse.global_configuration end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
8 9 10 |
# File 'lib/woodhouse/server.rb', line 8 def configuration @configuration end |
#layout ⇒ Object
Returns the value of attribute layout.
7 8 9 |
# File 'lib/woodhouse/server.rb', line 7 def layout @layout end |
#node ⇒ Object
Returns the value of attribute node.
7 8 9 |
# File 'lib/woodhouse/server.rb', line 7 def node @node end |
Instance Method Details
#ready_to_start? ⇒ Boolean
41 42 43 |
# File 'lib/woodhouse/server.rb', line 41 def ready_to_start? @node and @layout and @layout.node(@node) end |
#reload ⇒ Object
37 38 39 |
# File 'lib/woodhouse/server.rb', line 37 def reload dispatch_layout_changes! end |
#shutdown ⇒ Object
TODO: do this better
46 47 48 49 50 51 |
# File 'lib/woodhouse/server.rb', line 46 def shutdown @scheduler.spin_down @scheduler.terminate configuration.triggers.trigger :server_end signal :shutdown end |