Sha256: ad04a4fd6b938db5305915e20ec340bd7793af70931da584955166469756ecf8

Contents?: true

Size: 498 Bytes

Versions: 22

Compression:

Stored size: 498 Bytes

Contents

#
# if a block is specified then it is passed the child pid and run in a
# background thread.  note that this thread will __not__ be blocked during the
# execution of the command so it may do useful work such as killing the child
# if execution time passes a certain threshold
#
  require 'systemu'

  looper = %q( ruby -e" loop{ STDERR.puts Time.now.to_i; sleep 1 } " )

  status, stdout, stderr =
    systemu looper do |cid|
      sleep 3
      Process.kill 9, cid
    end

  p status
  p stderr

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
systemu-2.6.5 samples/f.rb
systemu-2.6.4 samples/f.rb
systemu-2.6.3 samples/f.rb
systemu-2.6.2 samples/f.rb
systemu-2.6.1 samples/f.rb
systemu-2.6.0 samples/f.rb
fragrant-0.0.5 vendor/bundle/ruby/1.9.1/gems/systemu-2.5.2/samples/f.rb
systemu-2.5.2 samples/f.rb
systemu-2.5.1 samples/f.rb
openvz-1.5 lib/openvz/vendor/systemu/samples/f.rb
systemu-2.5.0 samples/f.rb
openvz-1.4 lib/openvz/vendor/systemu/samples/f.rb
systemu-2.4.2 samples/f.rb
systemu-2.4.1 samples/f.rb
openvz-1.2 lib/openvz/vendor/systemu/samples/f.rb
openvz-1.1 lib/openvz/vendor/systemu/samples/f.rb
systemu-2.4.0 samples/f.rb
systemu-2.3.1 samples/f.rb
systemu-2.3.0 samples/f.rb
systemu-2.2.0 samples/f.rb