class_docstr: A ZMQ socket invoking a callback in the ioloop
docstr: Immediately processes all pending messages on this channel.
  
  This is only used for the IOPub channel.
  
  Callers should use this method to ensure that :meth:`call_handlers`
  has been called for all messages that have been received on the
  0MQ SUB socket of this channel.
  
  This method is thread safe.
  
  Parameters
  ----------
  timeout : float, optional
      The maximum amount of time to spend flushing, in seconds. The
      default is one second.
code: def flush(self, timeout=1.0):
      """Immediately processes all pending messages on this channel.
  
      This is only used for the IOPub channel.
  
      Callers should use this method to ensure that :meth:`call_handlers`
      has been called for all messages that have been received on the
      0MQ SUB socket of this channel.
  
      This method is thread safe.
  
      Parameters
      ----------
      timeout : float, optional
          The maximum amount of time to spend flushing, in seconds. The
          default is one second.
      """
      # We do the IOLoop callback process twice to ensure that the IOLoop
      # gets to perform at least one full poll.
      stop_time = time.time() + timeout
      for i in range(2):
          self._flushed = False
          self.ioloop.add_callback(self._flush)
          while not self._flushed and time.time() < stop_time:
              time.sleep(0.01)
  
imports: from __future__ import absolute_import
  import atexit
  import errno
  import sys
  from threading import Thread, Event
  import time
  from zmq import ZMQError
  from zmq.eventloop import ioloop, zmqstream
  from traitlets import Type, Instance
  from jupyter_client.channels import HBChannel
  from jupyter_client import KernelClient
label_desc: Use image node_id 10 for calling the ThreadedZMQSocketChannel obj's underlying member method code with example usage: obj.flush(timeout) without return types