class_docstr: A cache of ForwardMsgs.
  
  Large ForwardMsgs (e.g. those containing big DataFrame payloads) are
  stored in this cache. The server can choose to send a ForwardMsg's hash,
  rather than the message itself, to a client. Clients can then
  request messages from this cache via another endpoint.
  
  This cache is *not* thread safe. It's intended to only be accessed by
  the server thread.
class_docstr_tok: ["A","cache","of","ForwardMsgs",".","Large","ForwardMsgs","(","e.g",".","those","containing","big","DataFrame","payloads",")","are","stored","in","this","cache",".","The","server","can","choose","to","send","a","ForwardMsg","'s","hash",",","rather","than","the","message","itself",",","to","a","client",".","Clients","can","then","request","messages","from","this","cache","via","another","endpoint",".","This","cache","is","*","not","*","thread","safe",".","It","'s","intended","to","only","be","accessed","by","the","server","thread","."]
docstr: Add a ForwardMsg to the cache.
  
  The cache will also record a reference to the given AppSession,
  so that it can track which sessions have already received
  each given ForwardMsg.
  
  Parameters
  ----------
  msg : ForwardMsg
  session : AppSession
  script_run_count : int
      The number of times the session's script has run
docstr_tok: ["Add","a","ForwardMsg","to","the","cache",".","The","cache","will","also","record","a","reference","to","the","given","AppSession",",","so","that","it","can","track","which","sessions","have","already","received","each","given","ForwardMsg",".","Parameters","--","--","--","--","--","msg",":","ForwardMsg","session",":","AppSession","script_run_count",":","int","The","number","of","times","the","session","'s","script","has","run"]
code: def add_message(
      self,
      msg: ForwardMsg,
      session: "AppSession",
      script_run_count: int,
  ) -> None:
      """Add a ForwardMsg to the cache.
  
      The cache will also record a reference to the given AppSession,
      so that it can track which sessions have already received
      each given ForwardMsg.
  
      Parameters
      ----------
      msg : ForwardMsg
      session : AppSession
      script_run_count : int
          The number of times the session's script has run
  
      """
      populate_hash_if_needed(msg)
      entry = self._entries.get(msg.hash, None)
      if entry is None:
          if config.get_option(
              "global.storeCachedForwardMessagesInMemory"
          ):
              entry = ForwardMsgCache.Entry(msg)
          else:
              entry = ForwardMsgCache.Entry(None)
          self._entries[msg.hash] = entry
      entry.add_session_ref(session, script_run_count)
  
imports: import hashlib
  from typing import TYPE_CHECKING, Dict, List, MutableMapping, Optional
  from weakref import WeakKeyDictionary
  from streamlit import config, util
  from streamlit.logger import get_logger
  from streamlit.proto.ForwardMsg_pb2 import ForwardMsg
  from streamlit.runtime.stats import CacheStat, CacheStatsProvider, group_stats
  from streamlit.util import HASHLIB_KWARGS
label_desc: Use image node_id 3 for calling the ForwardMsgCache obj's underlying member method code with example usage: obj.add_message(msg, session, script_run_count) without return types