Sha256: fb685007b288af068ce0f235b0bfee5dec1426e1ead2dce67b4324ada1de32be

Contents?: true

Size: 403 Bytes

Versions: 20

Compression:

Stored size: 403 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'
Thread.current.backend.waitpid(pid)
puts 'parent done waiting'

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
polyphony-0.51.0 examples/core/forking.rb
polyphony-0.50.1 examples/core/forking.rb
polyphony-0.50.0 examples/core/forking.rb
polyphony-0.49.2 examples/core/forking.rb
polyphony-0.49.1 examples/core/forking.rb
polyphony-0.49.0 examples/core/forking.rb
polyphony-0.48.0 examples/core/forking.rb
polyphony-0.47.5.1 examples/core/forking.rb
polyphony-0.47.5 examples/core/forking.rb
polyphony-0.47.4 examples/core/forking.rb
polyphony-0.47.3 examples/core/forking.rb
polyphony-0.47.2 examples/core/forking.rb
polyphony-0.47.1 examples/core/forking.rb
polyphony-0.47.0 examples/core/forking.rb
polyphony-0.46.1 examples/core/forking.rb
polyphony-0.46.0 examples/core/forking.rb
polyphony-0.45.5 examples/core/forking.rb
polyphony-0.45.4 examples/core/forking.rb
polyphony-0.45.2 examples/core/forking.rb
polyphony-0.45.1 examples/core/forking.rb