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