class Async::LimitedQueue
def self.new(...)
- Private: - This exists purely for emitting a warning.
def self.new(...) warn("`require 'async/limited_queue'` to use `Async::LimitedQueue`.", uplevel: 1, category: :deprecated) if $VERBOSE super end
def initialize(limit = 1, **options)
@parameter limit [Integer] The maximum number of items that can be enqueued.
Create a new limited queue.
def initialize(limit = 1, **options) super(**options, delegate: Thread::SizedQueue.new(limit)) end
def limit
def limit @delegate.max end
def limited?
def limited? !@delegate.closed? && @delegate.size >= @delegate.max end