def pauseWorker(self, paused, killproc):
        """
        | Called from mainloop when checking killfile presence (also checked when registering).
        | Send a request to the dispatcher to update rendernode's state.
        | req: PUT /rendernodes/<currentRN>/paused/

        :param paused: boolean flag indicating the status to set for this worker
        :param killproc: boolean flag indicating if all running processes must be killed or not
        """
        while True:
            url = "/rendernodes/%s/paused/" % (self.computerName)
            dct = {}
            dct['paused'] = paused
            dct['killproc'] = killproc
            body = json.dumps(dct)
            headers = {'Content-Length': len(body)}
            try:
                self.httpconn.request('PUT', url, body, headers)
                response = self.httpconn.getresponse()
            except httplib.HTTPException:
                LOGGER.exception('"PUT %s" failed', url)
            except socket.error:
                LOGGER.exception('"PUT %s" failed', url)
            else:
                if response.status == 200:
                    if paused:
                        self.status = rendernode.RN_PAUSED
                        self.isPaused = True
                        LOGGER.info("Worker has been put in paused mode")
                    else:
                        self.status = rendernode.RN_IDLE
                        self.isPaused = False
                        LOGGER.info("Worker awakes from paused mode")
                return
            finally:
                self.httpconn.close()
dataset/ETHPy150Open mikrosimage/OpenRenderManagement/src/octopus/worker/worker.py/Worker.pauseWorker/original