Sha256: f3b690b8987449cb00e1b0f03dc2db9c617b0ef6e2dbdbb2c2942038b0207715

Contents?: true

Size: 322 Bytes

Versions: 90

Compression:

Stored size: 322 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'

spin do
  puts 'two'
  # spinning a fiber from the parent fiber allows us to schedule an operation to
  # be performed even after the current fiber is terminated
  Fiber.current.parent.spin { puts 'four' }
  puts 'three'
end

puts 'one'

suspend

Version data entries

90 entries across 90 versions & 1 rubygems

Version Path
polyphony-0.77 examples/core/deferring-an-operation.rb
polyphony-0.76 examples/core/deferring-an-operation.rb
polyphony-0.75 examples/core/deferring-an-operation.rb
polyphony-0.74 examples/core/deferring-an-operation.rb
polyphony-0.73.1 examples/core/deferring-an-operation.rb
polyphony-0.73 examples/core/deferring-an-operation.rb
polyphony-0.72 examples/core/deferring-an-operation.rb
polyphony-0.71 examples/core/deferring-an-operation.rb
polyphony-0.70 examples/core/deferring-an-operation.rb
polyphony-0.69 examples/core/deferring-an-operation.rb
polyphony-0.68 examples/core/deferring-an-operation.rb
polyphony-0.67 examples/core/deferring-an-operation.rb
polyphony-0.66 examples/core/deferring-an-operation.rb
polyphony-0.65 examples/core/deferring-an-operation.rb
polyphony-0.64 examples/core/deferring-an-operation.rb
polyphony-0.63 examples/core/deferring-an-operation.rb
polyphony-0.62 examples/core/deferring-an-operation.rb
polyphony-0.61 examples/core/deferring-an-operation.rb
polyphony-0.60 examples/core/deferring-an-operation.rb
polyphony-0.59.1 examples/core/deferring-an-operation.rb