Sha256: cf57a5697b2553013b20cba27cea3033aa49a6c2ac8be64fac736d590b5d79ac

Contents?: true

Size: 267 Bytes

Versions: 51

Compression:

Stored size: 267 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'

pong = spin_loop do
  msg, ping = receive
  puts msg
  ping << 'pong'
end

ping = spin do
  3.times do
    pong << ['ping', Fiber.current]
    msg = receive
    puts msg
  end
end

ping.await

Version data entries

51 entries across 51 versions & 1 rubygems

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