Sha256: a0d3d251d2e56b2127b01f9bee34b909ab6d1abcd207a81de63d62a338182577
Contents?: true
Size: 453 Bytes
Versions: 21
Compression:
Stored size: 453 Bytes
Contents
# frozen_string_literal: true require 'polyphony' require 'readline' # readline blocks the current thread, so we offload it to the blocking-ops # thread pool. That way, the reactor loop can keep running while waiting for # readline to return module ::Readline class << self alias_method :orig_readline, :readline Worker = Polyphony::ThreadPool.new(1) def readline(*args) Worker.process { orig_readline(*args) } end end end
Version data entries
21 entries across 21 versions & 1 rubygems