class_docstr: Default CommManager singleton implementation for Comms in the Kernel
class_docstr_tok: ["Default","CommManager","singleton","implementation","for","Comms","in","the","Kernel"]
docstr: Handler for comm_close messages
docstr_tok: ["Handler","for","comm_close","messages"]
code: def comm_close(
      self, stream: ZMQStream, ident: str, msg: MessageType
  ) -> None:  # noqa: ARG002
      """Handler for comm_close messages"""
      content = msg["content"]
      comm_id = content["comm_id"]
      comm = self.get_comm(comm_id)
      if comm is None:
          return
  
      self.comms[comm_id]._closed = True
      del self.comms[comm_id]
  
      try:
          comm.handle_close(msg)
      except Exception:
          logger.error(
              "Exception in comm_close for %s", comm_id, exc_info=True
          )
  
imports: from __future__ import annotations
  import contextlib
  import logging
  import typing
  import uuid
  from traitlets.utils.importstring import import_item
  import comm
label_desc: Use image node_id 9 for calling the CommManager obj's underlying member method code with example usage: obj.comm_close(stream, ident, msg) without return types