im running my function with multiprocessing implementation
def assign_task(self, module, command):
logging.debug("Assigning task for {0}".format(command._get_module_id()))
if self.queue is None:
self.queue = JoinableQueue()
if self.processes is None:
self.processes = [Process(target=self.do_execute) for i in range(self.max_process)]
for process in self.processes:
process.daemon = True
process.start()
logging.debug("Queuing message {0}".format(command._get_module_id()))
self.queue.put((module, command))
def do_execute(self):
# the code
but getting this error
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\muhammad.aqshol\AppData\Local\Programs\Python\Python38\lib\multiprocessing\spawn.py", line 107, in spawn_main
new_handle = reduction.duplicate(pipe_handle,
File "C:\Users\muhammad.aqshol\AppData\Local\Programs\Python\Python38\lib\multiprocessing\reduction.py", line 79, in duplicate
return _winapi.DuplicateHandle(
OSError: [WinError 6] The handle is invalid
Am i wrong on the implementation or something missing?