Class: Baykit::BayServer::Train::TrainRunner

Inherits:
Object
  • Object
show all
Includes:
Util
Defined in:
lib/baykit/bayserver/train/train_runner.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.exeObject (readonly)

Returns the value of attribute exe.



12
13
14
# File 'lib/baykit/bayserver/train/train_runner.rb', line 12

def exe
  @exe
end

Class Method Details

.init(num_agents) ⇒ Object



15
16
17
# File 'lib/baykit/bayserver/train/train_runner.rb', line 15

def self.init(num_agents)
  @exe = ExecutorService.new("TrainRunner", num_agents)
end

.post(train) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/baykit/bayserver/train/train_runner.rb', line 19

def self.post(train)
  begin
    @exe.submit(train)
    return true
  rescue => e
    BayLog.error_e(e)
    return false
  end
end