batch_on_files.py
def worker_sp(self, processCls):
        """
        A single-process version of the worker method.
        """
        args = self.dispatcher.getTask()
        dispatcher.putProcess({"num": args[0], "pos": args[1], "pid": 0})
        taskproc = processCls(args[2])
        result = taskproc.calculate(args[3])
        output = {
            "process": {"name": "Process-0", "pid": 0},
            "num": args[0],
            "pos": args[1],
            "args": args[3],
            "result": result,
        }
        # Put the result on the output queue
        self.dispatcher.putResult(output)

        A single-process version of the worker method.
        
A single-process version of the worker method.
A single - process version of the worker method .
def worker_sp(self, processCls):
        args = self.dispatcher.getTask()
        dispatcher.putProcess({"num": args[0], "pos": args[1], "pid": 0})
        taskproc = processCls(args[2])
        result = taskproc.calculate(args[3])
        output = {
            "process": {"name": "Process-0", "pid": 0},
            "num": args[0],
            "pos": args[1],
            "args": args[3],
            "result": result,
        }
        self.dispatcher.putResult(output)
def worker_sp ( self , processCls ) : args = self . dispatcher . getTask ( ) dispatcher . putProcess ( { "num" : args [ 0 ] , "pos" : args [ 1 ] , "pid" : 0 } ) taskproc = processCls ( args [ 2 ] ) result = taskproc . calculate ( args [ 3 ] ) output = { "process" : { "name" : "Process-0" , "pid" : 0 } , "num" : args [ 0 ] , "pos" : args [ 1 ] , "args" : args [ 3 ] , "result" : result , } self . dispatcher . putResult ( output )
A single-process version of the worker method.
A single - process version of the worker method .
"""
        A single-process version of the worker method.
        """ # Put the result on the output queue

self
processCls