class_docstr: Accumulates a session's outgoing ForwardMsgs.
  
  Each AppSession adds messages to its queue, and the Server periodically
  flushes all session queues and delivers their messages to the appropriate
  clients.
  
  ForwardMsgQueue is not thread-safe - a queue should only be used from
  a single thread.
class_docstr_tok: ["Accumulates","a","session","'s","outgoing","ForwardMsgs",".","Each","AppSession","adds","messages","to","its","queue",",","and","the","Server","periodically","flushes","all","session","queues","and","delivers","their","messages","to","the","appropriate","clients",".","ForwardMsgQueue","is","not","thread-safe","-","a","queue","should","only","be","used","from","a","single","thread","."]
docstr: Clear the queue and return a list of the messages it contained
  before being cleared.
docstr_tok: ["Clear","the","queue","and","return","a","list","of","the","messages","it","contained","before","being","cleared","."]
code: def flush(self) -> List[ForwardMsg]:
      """Clear the queue and return a list of the messages it contained
      before being cleared.
      """
      queue = self._queue
      self.clear()
      return queue
  
file_path: streamlit/lib/streamlit/runtime/forward_msg_queue.py
imports: from typing import Any, Dict, List, Optional, Tuple
  from streamlit.logger import get_logger
  from streamlit.proto.Delta_pb2 import Delta
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
label_desc: Use image node_id 6 for calling the ForwardMsgQueue obj's underlying member method code with example usage: obj.flush() and returns: queue