class Metasploit::Aggregator::EnumeratorQueue

A EnumeratorQueue wraps a Queue to yield the items added to it.

Public Class Methods

new(sentinel) click to toggle source
# File lib/metasploit/aggregator.rb, line 265
def initialize(sentinel)
  @q = Queue.new
  @sentinel = sentinel
end

Public Instance Methods

each_item() { |r| ... } click to toggle source
# File lib/metasploit/aggregator.rb, line 270
def each_item
  return enum_for(:each_item) unless block_given?
  loop do
    r = @q.pop
    break if r.equal?(@sentinel)
    fail r if r.is_a? Exception
    yield r
  end
end