def __startComponent(self): if not self.isStarted(): return utils.cancelTimeout(self._delayed) self._delayed = None if self._pendingName: self.log("Canceling component startup for task '%s', " "component '%s' is pending", self.label, self._pendingName) return if not self._workerPxy: self.warning("Couldn't start component for task '%s', " "no worker found", self.label) return compPxy = self.getActiveComponent() if compPxy: workerPxy = compPxy.getWorkerProxy() if workerPxy == self._workerPxy: self.debug("The valid component '%s' is already started", compPxy.getName()) return # Set the pendingName right now to prevent other # transoder to be started self._pendingName = utils.genUniqueIdentifier() self.log("Admin task '%s' is looking for a potential component", self.label) # Check there is a valid transcoder already running d = self.__waitPotentialComponent(self.POTENTIAL_TIMEOUT) d.addCallbacks(self.__cbGotPotentialComponent, self.__ebPotentialComponentFailure)
def __newIdentifier(self): ident = utils.genUniqueIdentifier() return self._template['file-template'] % ident