Sha256: 3c929174628041de7213009934ceff6a44d9825866cbccafdaa58123c2c4bae5
Contents?: true
Size: 383 Bytes
Versions: 90
Compression:
Stored size: 383 Bytes
Contents
# frozen_string_literal: true require 'bundler/setup' require 'polyphony' def nap(tag, t) puts "#{Time.now} #{tag} napping for #{t} seconds..." sleep t puts "#{Time.now} #{tag} done napping" end # We launch two concurrent fibers, each sleeping for the given duration. spin { nap(:a, 1) } spin { nap(:b, 2) } # Calling suspend will block until no work is left to do suspend
Version data entries
90 entries across 90 versions & 1 rubygems