noxdafox/pebble

How can I use a multiprocessing.manager alongside with pebble to avoid re-importing the function everytime?

pedro-peixot0 opened this issue · 1 comments

My threads were taking too long to run and I noticed it was due to the file I am importing the function to run having a lot of imports and those being fetched by every new thread.

I saw that with multiprocessing you could use a manager to register functions and avoid this re-importing (https://stackoverflow.com/questions/48680134/how-to-avoid-double-imports-with-the-python-multiprocessing-module)
How can I do something like this still using pebble?

Hello,

please do not use GitHub to ask for questions. GH issues are to report bugs or unexpected behaviour and not to ask for guidance. For such, there is StackOverflow (in particular, the multiprocessing tag).

Pebble relies on the Python multiprocessing module. Hence, most of approaches which work for multiprocessing work for Pebble as well.