code: def close(self):
          
          if not self._closed:
              self.add_event(self._sentinel_event)
              self.flush()
              self._worker.join()
              self._ev_writer.close()
              self._closed = True
docs: Flushes the event file to disk and close the file.
          Call this method when you do not need the summary writer anymore.