Name

SizedQueue — Fixed-length queue class

Synopsis

This class represents queues of specified size capacity. The push operation may be blocked if the capacity is full.

Required Library

require ‘thread’

Inherited Class

Queue

Class Method

SizedQueue::new(max)

Creates a fixed-length queue with a maximum size of max

Instance Methods

q.max

Returns the maximum size of the queue

q.max=n

Sets the maximum length of the queue

Get Ruby in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.