code: def close(self):
      
      try:
        self._conn.send((self._CLOSE, None))
        self._conn.close()
      except IOError:
        # The connection was already closed.
        pass
      self._process.join()
docs: Send a close message to the external process and join it.