class_docstr: Source events from a threading.Queue, running another event framework
  
  The queue is polled, i.e., there is a latency/overhead tradeoff, since
  we cannot use ``await`` directly with a multithreaded queue.
  
  Allows mixing of another event loop, for example pyqt, on another thread.
  Note that, by default, a streamz.Source such as this one will start
  an event loop in a new thread, unless otherwise specified.
class_docstr_tok: ["Source","events","from","a","threading.Queue",",","running","another","event","framework","The","queue","is","polled",",","i.e.",",","there","is","a","latency\/overhead","tradeoff",",","since","we","can","not","use","``","await","``","directly","with","a","multithreaded","queue",".","Allows","mixing","of","another","event","loop",",","for","example","pyqt",",","on","another","thread",".","Note","that",",","by","default",",","a","streamz.Source","such","as","this","one","will","start","an","event","loop","in","a","new","thread",",","unless","otherwise","specified","."]
docstr: :param q: threading.Queue
      Any items pushed into here will become streamz events
  :param sleep_time: int
      Sets how long we wait before checking the input queue when
      empty (in s)
  :param kwargs:
      passed to streamz.Source
docstr_tok: [":","param","q",":","threading.Queue","Any","items","pushed","into","here","will","become","streamz","events",":","param","sleep_time",":","int","Sets","how","long","we","wait","before","checking","the","input","queue","when","empty","(","in","s",")",":","param","kwargs",":","passed","to","streamz.Source"]
code: def __init__(self, q, sleep_time=0.01, **kwargs):
      """
      :param q: threading.Queue
          Any items pushed into here will become streamz events
      :param sleep_time: int
          Sets how long we wait before checking the input queue when
          empty (in s)
      :param kwargs:
          passed to streamz.Source
      """
      self.q = q
      self.sleep = sleep_time
      super().__init__(**kwargs)
  
imports: import asyncio
  from glob import glob
  import queue
  import os
  import time
  from tornado import gen
  import weakref
  from .core import Stream, convert_interval, RefCounter, sync
label_desc: Use image node_id 1 to create a new from_q object from inherited base classes: Source with example: obj = from_q(q, sleep_time)