Class: Pokan::Cluster::Autorunner
- Inherits:
-
Object
- Object
- Pokan::Cluster::Autorunner
- Defined in:
- lib/pokan-cluster/autorunner.rb
Overview
Class used for automatically run a server that include Pokan::Cluster module.
Class Attribute Summary collapse
-
.options ⇒ Object
Returns the value of attribute options.
-
.server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
-
.register_server(server_class) ⇒ Object
Registers a new server, that will be started when the method Pokan::Cluster::Autorunner.run gets called.
-
.run ⇒ Object
Calls the method ‘start` on every registered server.
-
.run? ⇒ Boolean
Checks if we have any server to start.
Class Attribute Details
.options ⇒ Object
Returns the value of attribute options.
11 12 13 |
# File 'lib/pokan-cluster/autorunner.rb', line 11 def @options end |
.server ⇒ Object
Returns the value of attribute server.
10 11 12 |
# File 'lib/pokan-cluster/autorunner.rb', line 10 def server @server end |
Class Method Details
.register_server(server_class) ⇒ Object
Registers a new server, that will be started when the method Pokan::Cluster::Autorunner.run gets called.
16 17 18 |
# File 'lib/pokan-cluster/autorunner.rb', line 16 def self.register_server(server_class) @server = server_class end |
.run ⇒ Object
Calls the method ‘start` on every registered server
26 27 28 |
# File 'lib/pokan-cluster/autorunner.rb', line 26 def self.run @server.start(@options) end |
.run? ⇒ Boolean
Checks if we have any server to start
21 22 23 |
# File 'lib/pokan-cluster/autorunner.rb', line 21 def self.run? @server.respond_to? :start end |