Sha256: 9815367d41d4ee351be59c88e70e1c158b0344d104ff0fdba74df971aab425e1

Contents?: true

Size: 360 Bytes

Versions: 39

Compression:

Stored size: 360 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'

require 'polyphony/core/debug'
Polyphony::Trace.start_event_firehose(STDOUT)

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

ping = spin(:ping) do
  1.times do
    pong << ['ping', Fiber.current]
    msg = receive
    puts msg
  end
end

ping.await

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
polyphony-0.96 examples/core/pingpong.rb
polyphony-0.95 examples/core/pingpong.rb
polyphony-0.94 examples/core/pingpong.rb
polyphony-0.93 examples/core/pingpong.rb
polyphony-0.92 examples/core/pingpong.rb
polyphony-0.91 examples/core/pingpong.rb
polyphony-0.90 examples/core/pingpong.rb
polyphony-0.89 examples/core/pingpong.rb
polyphony-0.87 examples/core/pingpong.rb
polyphony-0.86 examples/core/pingpong.rb
polyphony-0.85 examples/core/pingpong.rb
polyphony-0.84.1 examples/core/pingpong.rb
polyphony-0.84 examples/core/pingpong.rb
polyphony-0.83 examples/core/pingpong.rb
polyphony-0.82 examples/core/pingpong.rb
polyphony-0.81.1 examples/core/pingpong.rb
polyphony-0.81 examples/core/pingpong.rb
polyphony-0.80 examples/core/pingpong.rb
polyphony-0.79 examples/core/pingpong.rb