Sha256: decf5ef0b0dcc1de4d3742febe2971529d3c3d75536ab4f6b32d2bc5bcddce9a
Contents?: true
Size: 326 Bytes
Versions: 15
Compression:
Stored size: 326 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) } suspend
Version data entries
15 entries across 15 versions & 1 rubygems