private IEnumerable<Message> GetMessages() { while (this.messageQueue.Count > 0) { yield return this.messageQueue.Dequeue(); } }