Sha256: ce6218b2a1a788f3a1c2375be3f67db777514efe48ee30ba66b0895896d8338e
Contents?: true
Size: 373 Bytes
Versions: 1
Compression:
Stored size: 373 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' async def my_sleep(t) puts "#{t} start" sleep(t) puts "#{t} done" end puts "#{Time.now} waiting..." supervise do |s| s.coproc my_sleep(1) s.coproc my_sleep(2) s.coproc my_sleep(3) s.spin { puts "fiber count: #{Polyphony::FiberPool.size}" } end puts "#{Time.now} done waiting"
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
polyphony-0.19 | examples/core/supervisor.rb |