Sha256: fb506864b5ea4446ea73d52877c5c635e10c7edbe0ddb0bd42f8719fbe107b3c

Contents?: true

Size: 470 Bytes

Versions: 17

Compression:

Stored size: 470 Bytes

Contents

require 'bundler/setup'
require 'forking'

root = File.expand_path(File.dirname(__FILE__))

f = Forking.new(:name => 'forking', :working_dir => root,
    :log_file => "#{root}/forking.log", 
    :pid_file => "#{root}/forking.pid", :sync_log => true)

3.times do |i|
  f.spawn(:log_file => "#{root}/child#{i}.log", :sync_log => true) do
    $0 = "forking child"
    loop do
      p "#{Time.now} - #{Time.now.to_f} - #{i} - tick" 
      sleep 0.1
    end
  end
end

f.run!

Version data entries

17 entries across 11 versions & 2 rubygems

Version Path
reel-eye-0.3.2 examples/processes/forking.rb
eye-0.3.2 examples/processes/forking.rb
reel-eye-0.3.1 examples/processes/forking.rb
eye-0.3.1 examples/processes/forking.rb
eye-0.3 examples/processes/forking.rb
eye-0.2.4 examples/processes/forking.rb
eye-0.2.4 spec/example/forking.rb
eye-0.2.3 examples/processes/forking.rb
eye-0.2.3 spec/example/forking.rb
eye-0.2.2 spec/example/forking.rb
eye-0.2.2 examples/processes/forking.rb
eye-0.2.1 spec/example/forking.rb
eye-0.2.1 examples/processes/forking.rb
eye-0.2 examples/processes/forking.rb
eye-0.2 spec/example/forking.rb
eye-0.1.11 examples/processes/forking.rb
eye-0.1.11 spec/example/forking.rb