yield static method

MessageQueue yield(
  1. String channelId
)

Gets the message queue assigned to a channel id. Will create a new empty message queue if non existing is present and assign it to the channel id.

Implementation

static MessageQueue yield(String channelId) {
  MessageQueue? existingMessageQueue = messageQueueByChannelId[channelId];

  if ( existingMessageQueue != null ) {
    return existingMessageQueue;
  } else {
    MessageQueue messageQueue = MessageQueue();
    messageQueueByChannelId[channelId] = messageQueue;
    return messageQueue;
  }
}