Parent

Files

Class/Module Index [+]

Quicksearch

Concurrent::Channel::UnbufferedChannel

@api Channel @!macro edge_warning

Public Class Methods

new() click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 10
def initialize
  @probe_set = WaitableList.new
end

Public Instance Methods

pop() click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 23
def pop
  probe = Channel::Probe.new
  select(probe)
  probe.value
end
probe_set_size() click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 14
def probe_set_size
  @probe_set.size
end
push(value) click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 18
def push(value)
  until @probe_set.take.try_set([value, self])
  end
end
remove_probe(probe) click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 33
def remove_probe(probe)
  @probe_set.delete(probe)
end
select(probe) click to toggle source
# File lib/concurrent/channel/unbuffered_channel.rb, line 29
def select(probe)
  @probe_set.put(probe)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.