def pushJobResults(self, jobId, result, parameters, workerName): jobId = serialization.loads(jobId) result = serialization.loads(result) parameters = serialization.loads(parameters) # Remove the job mapping. with self.__lock: try: del self.__activeJobs[jobId] except KeyError: # The job's results were already submitted. return if self.__bestResult is None or result > self.__bestResult: logger.info("Best result so far %s with parameters %s" % (result, parameters)) self.__bestResult = result self.__resultSinc.push(result, base.Parameters(*parameters))
def getNextJob(self): ret = retry_on_network_error(self.__server.getNextJob) ret = serialization.loads(ret) return ret
def getInstrumentsAndBars(self): ret = retry_on_network_error(self.__server.getInstrumentsAndBars) ret = serialization.loads(ret) return ret