class Async::LimitedQueue
def enqueue(*items)
If the queue is full, this method will block until there is space available.
Add multiple items to the queue.
def enqueue(*items) while !items.empty? while limited? @full.wait end available = @limit - @items.size @items.concat(items.shift(available)) @available.signal unless self.empty? end end