示例#1
0
    def add_call(self,
                 procedure,
                 num_output,
                 args,
                 kwargs,
                 code_type,
                 new_code=None):
        """Override function of Worker class. If it is the first execution set
        all intern attributes and run the execution. Else call the Worker
        function.

        Arguments:
            - procedure: name of the function to be executed.
            - num_output: number of outputs of the function.
            - args: arguments used in the call of the function.
            - kwargs: key arguments used in the call of the function.
            - code_type: Type of the MultiCode used.
            - new_code: Code of the created task.
                If is None code will be computed.
        """
        if not self.running:
            return self.run(procedure, args, kwargs)
        else:
            try:
                return Worker.add_call(self, procedure, num_output, args,
                                       kwargs, code_type, new_code)
            except TypeError:
                raise TypeError("Error in %s adding call to function %s" %
                                (self.procedure.name, procedure))
示例#2
0
    def add_call(self, procedure, num_output, args, kwargs, code_type,
                 new_code=None):
        """Override function of Worker class. If it is the first execution set
        all intern attributes and run the execution. Else call the Worker
        function.

        Arguments:
            - procedure: name of the function to be executed.
            - num_output: number of outputs of the function.
            - args: arguments used in the call of the function.
            - kwargs: key arguments used in the call of the function.
            - code_type: Type of the MultiCode used.
            - new_code: Code of the created task.
                If is None code will be computed.
        """
        if not self.running:
            return self.run(procedure, args, kwargs)
        else:
            try:
                return Worker.add_call(self, procedure, num_output, args,
                    kwargs, code_type, new_code)
            except TypeError:
                raise TypeError("Error in %s adding call to function %s"
                                % (self.procedure.name, procedure))