Method: OpenC3.run_process

Defined in:
lib/openc3/top_level.rb

.run_process(command) ⇒ Object

Executes the command in a new Ruby Thread.

Parameters:

  • The command to execute via the 'system' call



155
156
157
158
159
160
161
162
163
164
# File 'lib/openc3/top_level.rb', line 155

def self.run_process(command)
  thread = nil
  thread = Thread.new do
    system(command)
  end
  # Wait for the thread and process to start
  sleep 0.01 until !thread.status.nil?
  sleep 0.1
  thread
end