resize method Null safety

void resize(
  1. String name,
  2. int newSize
)

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.

This is expected to be called by platform-specific plugin code (indirectly via the control channel), not by code on the framework side. See handleMessage.

Calling this from framework code is redundant since by the time framework code can be running, it can just subscribe to the relevant channel and there is therefore no need for any buffering.

Implementation

void resize(String name, int newSize) {
  _Channel? channel = _channels[name];
  if (channel == null) {
    channel = _Channel(newSize);
    _channels[name] = channel;
  } else {
    channel.capacity = newSize;
  }
}