flushStreamBuffer method

void flushStreamBuffer()

Flushes buffered streams that were received before a listener was attached. This ensures that listeners attached after stream creation still receive the stream event.

Implementation

void flushStreamBuffer() {
  final streamsToProcess = List<UDXStream>.from(_streamBuffer);
  _streamBuffer.clear();
  for (final stream in streamsToProcess) {
    // Re-emit the event. If a listener is now present, it will be handled.
    emit('stream', stream);
  }
}