module Goroutine
Constants
- VERSION
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/goroutine.rb, line 6 def initialize(*args) super(*args) @rd, wr = IO.pipe rd, @wr = IO.pipe go do loop do IO.select([rd]) rd.read(1) wr.write('.') end end end
Public Instance Methods
pop()
click to toggle source
Calls superclass method
# File lib/goroutine.rb, line 19 def pop @rd.read(1) super end
push(val)
click to toggle source
Calls superclass method
# File lib/goroutine.rb, line 26 def push(val) @wr.write('.') super(val) end
to_io()
click to toggle source
# File lib/goroutine.rb, line 33 def to_io @rd end
wait()
click to toggle source
# File lib/goroutine.rb, line 37 def wait IO.select([self])[0] end
Also aliased as: ready