Class: BotBaseDRbServer

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

Instance Method Summary collapse

Constructor Details

#initialize(host: 'localhost', port: '60600', config: '', notifier: nil, log: nil) ⇒ BotBaseDRbServer

Returns a new instance of BotBaseDRbServer.



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/botbase_drb_server.rb', line 12

def initialize(host: 'localhost', port: '60600', config: '', 
               notifier: nil, log: nil)

  log.info 'BotBaseDRbServer/initialize: active' if log
  
  @host, @port, @log = host, port, log
  @bot = BotBase.new(config, notifier: notifier, log: log)
  
  log.info 'BotBaseDRbServer/initialize: completed' if log

end

Instance Method Details

#startObject



24
25
26
27
28
29
30
# File 'lib/botbase_drb_server.rb', line 24

def start()

  @log.info 'BotBaseDRbServer/start: active' if @log
  DRb.start_service "druby://#{@host}:#{@port}", @bot
  DRb.thread.join

end