Support Loky executors?
I am trying to make parallel process calls to opencv functions, which are currently suffering from this issue: https://github.com/opencv/opencv/issues/5150#issuecomment-400727184
A suggested workaround is to get the Process executors from Loky.
Out of the box Loky runs into context problems with Flask, which is how I ended up here.
Could flask-executor be made to work with Loky and so open the door for parallel processing of opencv calls within Flask?
Thanks for all help
In executor.py I tried to replace concurrent.futures.ProcessPoolExecutor with loky.get_reusable_executor, but this throws up context problems:
RuntimeError: Working outside of application context.
This typically means that you attempted to use functionality that needed
to interface with the current application object in some way. To solve
this, set up an application context with app.app_context(). See the
documentation for more information.
I am tracking this in a SO question at https://stackoverflow.com/questions/58093735/flask-how-do-i-successfully-use-multiprocessing-not-multithreading
So far I can get flask-executor working well, but without opencv. Assuming Loky can handle the latter problem, can flask-executor be made to work with Loky? What magic is Loky providing that flask-executor doesn't?
Thanks!
I expect this to no longer be an issue, given recent changes that wrap each callable in a new application context.