Class: Nonnative::Process
Instance Attribute Summary
Attributes inherited from Runner
Instance Method Summary collapse
-
#initialize(service) ⇒ Process
constructor
A new instance of Process.
- #memory ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Methods inherited from Runner
Constructor Details
Instance Method Details
#memory ⇒ Object
31 32 33 34 35 |
# File 'lib/nonnative/process.rb', line 31 def memory return if pid.nil? @memory ||= GetProcessMem.new(pid) end |
#start ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/nonnative/process.rb', line 11 def start unless process_exists? proxy.start @pid = process_spawn wait_start end [pid, ::Process.waitpid2(pid, ::Process::WNOHANG).nil?] end |
#stop ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/nonnative/process.rb', line 21 def stop if process_exists? process_kill proxy.stop wait_stop end pid end |