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","."]
code: def __init__(self):
      self._queue: List[ForwardMsg] = []
      # A mapping of (delta_path -> _queue.indexof(msg)) for each
      # Delta message in the queue. We use this for coalescing
      # redundant outgoing Deltas (where a newer Delta supersedes
      # an older Delta, with the same delta_path, that's still in the
      # queue).
      self._delta_index_map: Dict[Tuple[int, ...], int] = dict()
  
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 1 to create a new ForwardMsgQueue object  with example: obj = ForwardMsgQueue()