yieldAll static method

List<WaitingMessage> yieldAll()

Get a list of all waiting messages from all message queues.

Implementation

static List<WaitingMessage> yieldAll() {
  List<WaitingMessage> allEvents = [];

  // Iterate through each MessageQueue in the map
  messageQueueByChannelId.forEach((channelId, messageQueue) {
    // Extract LocalityEvents from each WaitingMessage in the queue
    for (var waitingMessage in messageQueue.waitingMessages) {
      allEvents.add(waitingMessage);
    }
  });

  return allEvents;
}