Method: OpenC3::Bridge#initialize
- Defined in:
- lib/openc3/bridge/bridge.rb
#initialize(filename, existing_variables = {}) ⇒ Bridge
Returns a new instance of Bridge.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/openc3/bridge/bridge.rb', line 30 def initialize(filename, existing_variables = {}) @config = BridgeConfig.new(filename, existing_variables) @threads = [] # Start Interface Threads @config.interfaces.each do |interface_name, interface| @threads << BridgeInterfaceThread.new(interface) @threads[-1].start end # Start Router Threads @config.routers.each do |router_name, router| @threads << BridgeRouterThread.new(router) @threads[-1].start end at_exit() do shutdown() end end |