Sha256: 76a26017c032ce130aaaa0434cf8a3fc5383aecdc7c91a0267161a3de7434a20

Contents?: true

Size: 427 Bytes

Versions: 1

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'

def my_sleep(t)
  puts "start: #{t}"
  r = sleep(t)
  puts "my_sleep result #{r.inspect}"
  puts "done: #{t}"
end

puts "#{Time.now} going to sleep..."
move_on_after(0.5) do
  supervise do |s|
    puts 'supervise block'
    s.spin my_sleep(1)
    s.spin my_sleep(2)
    s.spin my_sleep(3)
  end
  puts 'supervisor done'
end
puts "#{Time.now} woke up"

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
polyphony-0.23 examples/core/supervisor_with_cancel_scope.rb