New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiprocessing issues #42
Comments
Yeah, so for context let me paste my answer from the previous issue and clarify slightly I am unconvinced that this is a problem on our end. Dig into the SO page here: https://stackoverflow.com/questions/9336646/python-decorator-with-multiprocessing-fails TL;DR ProcessPools can only accept pickleable things to spawn into processes. Decorated functions are inherently not pickleable, since it's a function wrapper and not an actual function. Basically the problem is that when you use The best workaround that I can see is something like this: def test_one_widget(widget_id: int) -> int:
@enforce.runtime_validation
def foo(widget_id: int) -> int:
score = widget_inspector(widget_id, a='foo', b=4, c='bar')
return score
return foo(widget_id) Where, if you need to multiprocess on a certain function that EDIT: This is a problem that affects any decorator that uses |
I might have an idea how to fix this but it will require a massive re-write of almost everything. It is not very feasible at this stage. I think the best course of action for now is to add this workaround to the Readme. |
Continuation of Issue #36 - threading issues.
So, does anyone know how to make it work with multiprocessing? I cannot grasp where exactly the issue is arising. Is it because of 'wrapt'?
The text was updated successfully, but these errors were encountered: