Class: Puppeteer::BrowserRunner::BrowserProcess
- Inherits:
-
Object
- Object
- Puppeteer::BrowserRunner::BrowserProcess
- Defined in:
- lib/puppeteer/browser_runner.rb
Instance Attribute Summary collapse
-
#stderr ⇒ Object
readonly
Returns the value of attribute stderr.
-
#stdout ⇒ Object
readonly
Returns the value of attribute stdout.
Instance Method Summary collapse
- #dispose ⇒ Object
-
#initialize(env, executable_path, args) ⇒ BrowserProcess
constructor
A new instance of BrowserProcess.
- #kill ⇒ Object
Constructor Details
#initialize(env, executable_path, args) ⇒ BrowserProcess
Returns a new instance of BrowserProcess.
23 24 25 26 27 |
# File 'lib/puppeteer/browser_runner.rb', line 23 def initialize(env, executable_path, args) stdin, @stdout, @stderr, @thread = Open3.popen3(env, executable_path, *args) stdin.close @pid = @thread.pid end |
Instance Attribute Details
#stderr ⇒ Object (readonly)
Returns the value of attribute stderr.
40 41 42 |
# File 'lib/puppeteer/browser_runner.rb', line 40 def stderr @stderr end |
#stdout ⇒ Object (readonly)
Returns the value of attribute stdout.
40 41 42 |
# File 'lib/puppeteer/browser_runner.rb', line 40 def stdout @stdout end |
Instance Method Details
#dispose ⇒ Object
35 36 37 38 |
# File 'lib/puppeteer/browser_runner.rb', line 35 def dispose [@stdout, @stderr].each { |io| io.close unless io.closed? } @thread.join end |
#kill ⇒ Object
29 30 31 32 33 |
# File 'lib/puppeteer/browser_runner.rb', line 29 def kill Process.kill(:KILL, @pid) rescue Errno::ESRCH # already killed end |