module ProcessExecuter
def self.spawn(*command, **options_hash)
-
(ProcessExecuter::ExecutionContext)
- the execution context that can run commands
Parameters:
-
options_hash
(Hash
) -- the options to use for this execution context -
command
(Array
) -- the command to execute
Other tags:
- See: ProcessExecuter::Options#initialize - See ProcessExecuter::Options#initialize
See: https://ruby-doc.org/core-3.1.2/Kernel.html#method-i-spawn - Kernel.spawn
Other tags:
- Example: with a timeout -
def self.spawn(*command, **options_hash) options = ProcessExecuter::Options.new(**options_hash) pid = ::Process.spawn(*command, **options.spawn_options) wait_for_process(pid, options) end
def self.wait_for_process(pid, options)
- Api: - private
Returns:
-
(ProcessExecuter::Status)
- the status of the process
Parameters:
-
options
(ProcessExecuter::Options
) -- the options used -
pid
(Integer
) -- the process id
def self.wait_for_process(pid, options) ions.timeout) do id).last L', pid) ).last