Sha256: 819f607a911ef912eb6fa2da95632b0de87ab276e428370f533efdfa8d2689c2

Contents?: true

Size: 350 Bytes

Versions: 21

Compression:

Stored size: 350 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'
require 'polyphony'
require 'polyphony/adapters/readline'

$counter = 0
timer = spin do
  throttled_loop(5) do
    $counter += 1
  end
end

at_exit { timer.stop }

puts 'try typing $counter to see the counter incremented in the background'
loop do
  puts eval Readline::readline('> ', true)
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
polyphony-1.6 examples/io/readline.rb
polyphony-1.5 examples/io/readline.rb
polyphony-1.4 examples/io/readline.rb
polyphony-1.3 examples/io/readline.rb
polyphony-1.2.1 examples/io/readline.rb
polyphony-1.2 examples/io/readline.rb
polyphony-1.1.1 examples/io/readline.rb
polyphony-1.1 examples/io/readline.rb
polyphony-1.0.2 examples/io/readline.rb
polyphony-1.0.1 examples/io/readline.rb
polyphony-1.0 examples/io/readline.rb
polyphony-0.99.6 examples/io/readline.rb
polyphony-0.99.5 examples/io/readline.rb
polyphony-0.99.4 examples/io/readline.rb
polyphony-0.99.3 examples/io/readline.rb
polyphony-0.99.2 examples/io/readline.rb
polyphony-0.99.1 examples/io/readline.rb
polyphony-0.99 examples/io/readline.rb
polyphony-0.98 examples/io/readline.rb
polyphony-0.97 examples/io/readline.rb