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-1.6 examples/core/deferring-an-operation.rb
polyphony-1.5 examples/core/deferring-an-operation.rb
polyphony-1.4 examples/core/deferring-an-operation.rb
polyphony-1.3 examples/core/deferring-an-operation.rb
polyphony-1.2.1 examples/core/deferring-an-operation.rb
polyphony-1.2 examples/core/deferring-an-operation.rb
polyphony-1.1.1 examples/core/deferring-an-operation.rb
polyphony-1.1 examples/core/deferring-an-operation.rb
polyphony-1.0.2 examples/core/deferring-an-operation.rb
polyphony-1.0.1 examples/core/deferring-an-operation.rb
polyphony-1.0 examples/core/deferring-an-operation.rb
polyphony-0.99.6 examples/core/deferring-an-operation.rb
polyphony-0.99.5 examples/core/deferring-an-operation.rb
polyphony-0.99.4 examples/core/deferring-an-operation.rb
polyphony-0.99.3 examples/core/deferring-an-operation.rb
polyphony-0.99.2 examples/core/deferring-an-operation.rb
polyphony-0.99.1 examples/core/deferring-an-operation.rb
polyphony-0.99 examples/core/deferring-an-operation.rb
polyphony-0.98 examples/core/deferring-an-operation.rb
polyphony-0.97 examples/core/deferring-an-operation.rb