module Kernel

Public Instance Methods

go(*args, &block) click to toggle source
# File lib/goroutine/ext.rb, line 10
def go(*args, &block)
  Thread.abort_on_exception = true
  Thread.new(*args, &block)
end
select(channels, &block) click to toggle source
# File lib/goroutine/ext.rb, line 2
def select(channels, &block)
  channels = Array(channels)
  loop do
    rs, _ = IO.select(channels)
    rs.each { |ch| block[ch.pop, channels.index(ch)] }
  end
end