Class: Baykit::BayServer::Agent::Multiplexer::TaxiMultiplexer::TaxiForMpx

Inherits:
Taxi::Taxi show all
Defined in:
lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb

Instance Attribute Summary collapse

Attributes inherited from Taxi::Taxi

#taxi_id

Attributes inherited from Common::Vehicle

#id

Instance Method Summary collapse

Methods inherited from Taxi::Taxi

#run, #to_s

Methods inherited from Common::Vehicle

#run

Constructor Details

#initialize(st, for_read) ⇒ TaxiForMpx

Returns a new instance of TaxiForMpx.



18
19
20
21
# File 'lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb', line 18

def initialize(st, for_read)
  @rudder_state = st
  @for_read = for_read
end

Instance Attribute Details

#for_readObject (readonly)

Returns the value of attribute for_read.



17
18
19
# File 'lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb', line 17

def for_read
  @for_read
end

#rudder_stateObject (readonly)

Returns the value of attribute rudder_state.



16
17
18
# File 'lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb', line 16

def rudder_state
  @rudder_state
end

Instance Method Details

#departObject



22
23
24
25
26
27
28
# File 'lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb', line 22

def depart
  if @for_read
    @rudder_state.multiplexer.do_next_read(@rudder_state)
  else
    @rudder_state.multiplexer.do_next_write(@rudder_state)
  end
end

#on_timerObject



30
31
32
33
34
# File 'lib/baykit/bayserver/agent/multiplexer/taxi_multiplexer.rb', line 30

def on_timer
  if @rudder_state.transporter != nil
    @rudder_state.transporter.check_timeout(@rudder_state.rudder, -1)
  end
end