Method: Polyphony::Queue#shift_each

Defined in:
ext/polyphony/queue.c

#shift_each {|any| ... } ⇒ Queue

Iterates over all values in the queue, removing each item and passing it to the given block.

Yields:

  • (any)

    removed item

Returns:

  • self



321
322
323
324
325
326
327
328
# File 'ext/polyphony/queue.c', line 321

VALUE Queue_shift_each(VALUE self) {
  Queue_t *queue;
  GetQueue(self, queue);

  ring_buffer_shift_each(&queue->values);
  if (queue->capacity) queue_schedule_blocked_fibers_to_capacity(queue);
  return self;
}