class_docstr: A client for an in-process kernel.
  
  This class implements the interface of
  `jupyter_client.clientabc.KernelClientABC` and allows
  (asynchronous) frontends to be used seamlessly with an in-process kernel.
  
  See `jupyter_client.client.KernelClient` for docstrings.
class_docstr_tok: ["A","client","for","an","in-process","kernel",".","This","class","implements","the","interface","of","`","jupyter_client.clientabc.KernelClientABC","`","and","allows","(","asynchronous",")","frontends","to","be","used","seamlessly","with","an","in-process","kernel",".","See","`","jupyter_client.client.KernelClient","`","for","docstrings","."]
docstr: Send a message to the kernel and handle a reply.
          
docstr_tok: ["Send","a","message","to","the","kernel","and","handle","a","reply","."]
code: def _dispatch_to_kernel(self, msg):
      """Send a message to the kernel and handle a reply."""
      kernel = self.kernel
      if kernel is None:
          raise RuntimeError("Cannot send request. No kernel exists.")
  
      stream = DummySocket()
      self.session.send(stream, msg)
      msg_parts = stream.recv_multipart()
      kernel.dispatch_shell(stream, msg_parts)
  
      idents, reply_msg = self.session.recv(stream, copy=False)
      self.shell_channel.call_handlers_later(reply_msg)
  
imports: from ipykernel.inprocess.socket import DummySocket
  from traitlets import Type, Instance, default
  from jupyter_client.clientabc import KernelClientABC
  from jupyter_client.client import KernelClient
  from .channels import InProcessChannel, InProcessHBChannel
label_desc: Use image node_id 17 for calling the InProcessKernelClient obj's underlying member method code with example usage: obj._dispatch_to_kernel(msg) without return types