code: def stop(self):
          
          if self.interval is not None:
              self._queue.put_nowait(None)
              self._thread.join()
              self.interval = None
docs: Tell the sender thread to finish and wait for it to stop sending
          (should be at most "timeout" seconds).