Class: Baykit::BayServer::Taxi::TaxiRunner

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.exeObject (readonly)

Returns the value of attribute exe.



11
12
13
# File 'lib/baykit/bayserver/taxi/taxi_runner.rb', line 11

def exe
  @exe
end

Class Method Details

.init(num_agents) ⇒ Object



14
15
16
# File 'lib/baykit/bayserver/taxi/taxi_runner.rb', line 14

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

.post(taxi) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/baykit/bayserver/taxi/taxi_runner.rb', line 18

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