Sha256: 2170ac45ec8a949c534dc39d7c33246c0fb641aecfe5a85d61f65c24980519db
Contents?: true
Size: 442 Bytes
Versions: 1
Compression:
Stored size: 442 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' async def my_sleep(t) puts "start: #{t}" sleep(t) puts "done: #{t}" end puts "#{Time.now} going to sleep..." result = supervise do |s| fiber = Fiber.current spin do sleep(0.5) puts "stopping supervisor..." s.stop! end s.coproc my_sleep(1) s.coproc my_sleep(2) s.coproc my_sleep(3) end puts "#{Time.now} woke up with #{result.inspect}"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
polyphony-0.19 | examples/core/supervisor_with_manual_move_on.rb |