class

StreamingController::ConnectionPool

Inherits Reference < Object

Limits the number of long-lived connections.

Limits the number of long-lived connections by maintaining a pool of connections. When the pool is full, adding a new connection closes the oldest connection.

A "connection" is any subclass of IO.

Constructors

new(capacity)
Source

Instance methods

capacity

Returns the capacity of the pool.

Source
includes?(connection)

Returns true if the pool includes connection.

Source
push(connection)

Pushes connection into the pool.

If the pool is at capacity, the oldest connection is closed, removed from the pool, and returned.

Source
size

Returns the number of connections in the pool.

Source