class_docstr: An object for sending IOPub messages in a background thread
  
  Prevents a blocking main thread from delaying output from threads.
  
  IOPubThread(pub_socket).background_socket is a Socket-API-providing object
  whose IO is always run in a thread.
class_docstr_tok: ["An","object","for","sending","IOPub","messages","in","a","background","thread","Prevents","a","blocking","main","thread","from","delaying","output","from","threads",".","IOPubThread","(","pub_socket",")",".background_socket","is","a","Socket-API-providing","object","whose","IO","is","always","run","in","a","thread","."]
docstr: Create IOPub thread
  
  Parameters
  ----------
  
  socket: zmq.PUB Socket
      the socket on which messages will be sent.
  pipe: bool
      Whether this process should listen for IOPub messages
      piped from subprocesses.
code: def __init__(self, socket, pipe=False):
      """Create IOPub thread
  
      Parameters
      ----------
  
      socket: zmq.PUB Socket
          the socket on which messages will be sent.
      pipe: bool
          Whether this process should listen for IOPub messages
          piped from subprocesses.
      """
      self.socket = socket
      self.background_socket = BackgroundSocket(self)
      self._master_pid = os.getpid()
      self._pipe_flag = pipe
      self.io_loop = IOLoop(make_current=False)
      if pipe:
          self._setup_pipe_in()
      self._local = threading.local()
      self._events = deque()
      self._setup_event_pipe()
      self.thread = threading.Thread(target=self._thread_main)
      self.thread.daemon = True
  
imports: from __future__ import print_function
  import atexit
  from binascii import b2a_hex
  from collections import deque
  import os
  import sys
  import threading
  import warnings
  from io import StringIO, TextIOBase
  import zmq
  from zmq.eventloop.ioloop import IOLoop
  from zmq.eventloop.zmqstream import ZMQStream
  from jupyter_client.session import extract_header
  from ipython_genutils import py3compat
  from ipython_genutils.py3compat import unicode_type
label_desc: Use image node_id 1 to create a new IOPubThread object from inherited base classes: object with example: obj = IOPubThread(socket, pipe)