resize method
Changes the capacity of the queue associated with the given channel.
This could result in the dropping of messages if newSize is less than the current length of the queue.
Implementation
void resize(String channel, int newSize) {
_RingBuffer<_StoredMessage> queue = _messages[channel];
if (queue == null) {
queue = _makeRingBuffer(newSize);
_messages[channel] = queue;
} else {
final int numberOfDroppedMessages = queue.resize(newSize);
if (numberOfDroppedMessages > 0) {
_Logger._printString('Dropping messages on channel "$channel" as a result of shrinking the buffer size.');
}
}
}