Sha256: 15c36da860919aea3bcefbd7570c44819b52af036a30114fe6264f98c90de071

Contents?: true

Size: 394 Bytes

Versions: 30

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'

puts "parent pid: #{Process.pid}"

pid = Polyphony.fork do
  puts "child pid: #{Process.pid}"

  spin do
    puts 'child going to sleep 1...'
    sleep 1
    puts 'child woke up 1'
  end

  suspend
end

puts "got child pid #{pid}"

puts 'parent waiting for child'
Gyro::Child.new(pid).await
puts 'parent done waiting'

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
polyphony-0.45.0 examples/core/xx-forking.rb
polyphony-0.44.0 examples/core/xx-forking.rb
polyphony-0.43.11 examples/core/xx-forking.rb
polyphony-0.43.10 examples/core/xx-forking.rb
polyphony-0.43.9 examples/core/xx-forking.rb
polyphony-0.43.8 examples/core/xx-forking.rb
polyphony-0.43.6 examples/core/xx-forking.rb
polyphony-0.43.5 examples/core/xx-forking.rb
polyphony-0.43.4 examples/core/xx-forking.rb
polyphony-0.43.3 examples/core/xx-forking.rb
polyphony-0.43.2 examples/core/xx-forking.rb
polyphony-0.43.1 examples/core/xx-forking.rb
polyphony-0.43 examples/core/xx-forking.rb
polyphony-0.42 examples/core/xx-forking.rb
polyphony-0.41 examples/core/xx-forking.rb
polyphony-0.40 examples/core/xx-forking.rb
polyphony-0.39 examples/core/xx-forking.rb
polyphony-0.38 examples/core/xx-forking.rb
polyphony-0.36 examples/core/xx-forking.rb
polyphony-0.34 examples/core/xx-forking.rb