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

<<(val)
Alias for: push
deq()
Alias for: pop
enq(val)
Alias for: push
pop() click to toggle source
Calls superclass method
# File lib/goroutine.rb, line 19
def pop
  @rd.read(1)
  super
end
Also aliased as: shift, deq
push(val) click to toggle source
Calls superclass method
# File lib/goroutine.rb, line 26
def push(val)
  @wr.write('.')
  super(val)
end
Also aliased as: <<, enq
ready()
Alias for: wait
shift()
Alias for: pop
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