def close(self):
        """
        Closes the worker. No more jobs will be handled by the worker, and any
        running job is immediately returned to the job manager.
        """

        if self._closed:
            return

        self._closed = True

        if self._job is not None:
            self._manager.return_job(self._job)
            self._job = None
Closes the worker. No more jobs will be handled by the worker, and any
        running job is immediately returned to the job manager.