examples/io/echo_client.rb in polyphony-0.17 vs examples/io/echo_client.rb in polyphony-0.19
- old
+ new
@@ -3,14 +3,14 @@
require 'bundler/setup'
require 'polyphony'
socket = Polyphony::Net.tcp_connect('127.0.0.1', 1234)
-writer = coproc do
+writer = spin do
throttled_loop(1) { socket << "#{Time.now}\n" rescue nil }
end
-reader = coproc do
+reader = spin do
puts "received from echo server:"
while data = socket.readpartial(8192)
STDOUT << data
end
end