Sha256: 9de0e0fdec1a2141fcd14269e5ccd4fc41d2fd7826f9c75d1c90d11e64b98222

Contents?: true

Size: 423 Bytes

Versions: 10

Compression:

Stored size: 423 Bytes

Contents

require "pty"

begin
  PTY.spawn("spawn-fcgi -p 9000 /usr/bin/fcgiwrap -f") do |stdout, stdin, pid|
    begin
      # Do stuff with the output here. Just printing to show it works
      stdout.each { |line| print line }
    rescue Errno::EIO
      # puts "Errno:EIO error, but this probably just means that the process has finished giving output"
    end
  end
rescue PTY::ChildExited
  puts "The child process exited!"
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
smartcloud-0.0.134 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.133 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.132 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.131 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.130 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.129 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.128 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.127 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.126 lib/smartcloud/grids/grid-runner/spawner.rb
smartcloud-0.0.125 lib/smartcloud/grids/grid-runner/spawner.rb