Class: Librr::CmdServer
- Inherits:
-
Object
- Object
- Librr::CmdServer
- Defined in:
- lib/librr/cmd_server.rb
Defined Under Namespace
Classes: CmdServerHandler
Instance Attribute Summary collapse
-
#indexer ⇒ Object
Returns the value of attribute indexer.
-
#monitor ⇒ Object
Returns the value of attribute monitor.
Instance Method Summary collapse
Instance Attribute Details
#indexer ⇒ Object
Returns the value of attribute indexer.
9 10 11 |
# File 'lib/librr/cmd_server.rb', line 9 def indexer @indexer end |
#monitor ⇒ Object
Returns the value of attribute monitor.
9 10 11 |
# File 'lib/librr/cmd_server.rb', line 9 def monitor @monitor end |
Instance Method Details
#init(opts) ⇒ Object
11 12 13 14 15 |
# File 'lib/librr/cmd_server.rb', line 11 def init opts self.monitor = opts[:monitor] self.indexer = opts[:indexer] CmdServerHandler.set_server(self) end |
#start(&block) ⇒ Object
17 18 19 20 |
# File 'lib/librr/cmd_server.rb', line 17 def start(&block) EventMachine.start_server "localhost", Settings.runner_port, CmdServerHandler EM.add_timer(1){ block.call if block } end |