code: def stop(self):
          
          BufferedReader.stop(self)
          self._stop_running_event.set()
          self._writer_thread.join()
          BaseIOHandler.stop(self)
docs: Stops the reader an writes all remaining messages to the database. Thus, this
          might take a while and block.