Module: Kernel

Defined in:
lib/ruby_channel.rb

Instance Method Summary collapse

Instance Method Details

#go(*args) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/ruby_channel.rb', line 13

def go(*args)
  Thread.new do
    begin
      yield(*args)
    rescue Exception => e
      p e
      p e.backtrace
    end
  end
end

#select_channel {|s| ... } ⇒ Object

Yields:

  • (s)


24
25
26
27
28
# File 'lib/ruby_channel.rb', line 24

def select_channel
  s = RubyChannel::Selector.new
  yield s
  s.select
end