Module: ProconBypassMan::ExternalInput
- Defined in:
- lib/procon_bypass_man/external_input.rb,
lib/procon_bypass_man/external_input/channels.rb,
lib/procon_bypass_man/external_input/boot_message.rb,
lib/procon_bypass_man/external_input/channels/base.rb,
lib/procon_bypass_man/external_input/external_data.rb,
lib/procon_bypass_man/external_input/channels/tcpip_channel.rb,
lib/procon_bypass_man/external_input/channels/serial_port_channel.rb
Defined Under Namespace
Modules: Channels Classes: BootMessage, ExternalData, ParseError
Class Method Summary collapse
- .channels ⇒ Array<ProconBypassMan::ExternalInput::Channels::Base>
-
.read ⇒ NilClass, String
NOTE: 外部入力からのreadがボトルネックになるなら、Concurrent::Futureを使ってプロコンからの読み出しと並列化することを検討する.
- .shutdown ⇒ Object
Class Method Details
.channels ⇒ Array<ProconBypassMan::ExternalInput::Channels::Base>
8 9 10 |
# File 'lib/procon_bypass_man/external_input.rb', line 8 def self.channels @@channels ||= ProconBypassMan.config.external_input_channels end |
.read ⇒ NilClass, String
NOTE: 外部入力からのreadがボトルネックになるなら、Concurrent::Futureを使ってプロコンからの読み出しと並列化することを検討する
18 19 20 21 22 23 24 25 |
# File 'lib/procon_bypass_man/external_input.rb', line 18 def self.read value = nil channels.each do |channel| value = channel.read break if value end value end |
.shutdown ⇒ Object
12 13 14 |
# File 'lib/procon_bypass_man/external_input.rb', line 12 def self.shutdown channels.each(&:shutdown) end |