class_docstr: Read from MQTT source
  
  See https://en.wikipedia.org/wiki/MQTT for a description of the protocol
  and its uses.
  
  See also ``sinks.to_mqtt``.
  
  Requires ``paho.mqtt``
  
  The outputs are ``paho.mqtt.client.MQTTMessage`` instances, which each have
  attributes timestamp, payload, topic, ...
  
  NB: paho.mqtt.python runs on its own thread in this implementation. We may
  wish to instead call client.loop() directly
  
  :param host: str
  :param port: int
  :param topic: str
      (May in the future support a list of topics)
  :param keepalive: int
      See mqtt docs - to keep the channel alive
  :param client_kwargs:
      Passed to the client's ``connect()`` method
class_docstr_tok: ["Read","from","MQTT","source","See","https",":","\/\/en.wikipedia.org\/wiki\/MQTT","for","a","description","of","the","protocol","and","its","uses",".","See","also","``","sinks.to_mqtt","``",".","Requires","``","paho.mqtt","``","The","outputs","are","``","paho.mqtt.client.MQTTMessage","``","instances",",","which","each","have","attributes","timestamp",",","payload",",","topic",",","...","NB",":","paho.mqtt.python","runs","on","its","own","thread","in","this","implementation",".","We","may","wish","to","instead","call","client.loop","(",")","directly",":","param","host",":","str",":","param","port",":","int",":","param","topic",":","str","(","May","in","the","future","support","a","list","of","topics",")",":","param","keepalive",":","int","See","mqtt","docs","-","to","keep","the","channel","alive",":","param","client_kwargs",":","Passed","to","the","client","'s","``","connect","(",")","``","method"]
code: def __init__(
      self,
      host,
      port,
      topic,
      keepalive=60,
      client_kwargs=None,
      user=None,
      pw=None,
      **kwargs,
  ):
      self.host = host
      self.port = port
      self.keepalive = keepalive
      self.topic = topic
      self.client_kwargs = client_kwargs
      self.user = user
      self.pw = pw
      super().__init__(q=queue.Queue(), **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_mqtt object from inherited base classes: from_q with example: obj = from_mqtt(host, port, topic, keepalive, client_kwargs, user, pw)