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