'Shuts down the thread.'

def close(self):

    if (not self.closed):
        self.logger.debug('Closing    writer    thread')
    self.closed = True
    self.reader.buffer.close()
    self.executor.shutdown(wait=True)
