flatcam/FlatCAMPool.py
Marius Stanciu 32ff417a2c - fixed a bug in Excellon Editor that crashed the app when editing the first tool added automatically into a new black Excellon file
- made sure that if the big mouse cursor is selected, the utility geometry in Excellon Editor has a thicker line width (2 pixels now) so it is visible over the geometry of the mouse cursor
2019-09-28 21:29:23 +03:00

33 lines
756 B
Python

from PyQt5 import QtCore
from multiprocessing import Pool, cpu_count
import dill
def run_dill_encoded(what):
fun, args = dill.loads(what)
print("load", fun, args)
return fun(*args)
def apply_async(pool, fun, args):
print("...", fun, args)
print("dumps", dill.dumps((fun, args)))
return pool.map_async(run_dill_encoded, (dill.dumps((fun, args)),))
def func1():
print("func")
class WorkerPool(QtCore.QObject):
def __init__(self):
super(WorkerPool, self).__init__()
self.pool = Pool(cpu_count())
def add_task(self, task):
print("adding task", task)
# task['fcn'](*task['params'])
# print self.pool.map(task['fcn'], task['params'])
apply_async(self.pool, func1, ())