Combining Greenleets with Flask, and Standard Threads
The short answer is that yes, your main and sub-processes do not necessarily need to be both using eventlet. Nothing wrong with not using it in the sub-process, and in fact, if you are going to be communicating with hardware, using eventlet is almost always not going to work well.
I think you can make things work in the way you are starting your sub-process, but in my opinion, you are going to have less challenges if you run these two processes separately, not one as a sub-process of the other. Your main process will be 100% eventlet with everything monkey patched, while your camera process will have absolutely no trace of eventlet in it. Communication between these two processes is done through any available IPC mechanism. You can use queues, sockets, etc. The camera process will start and go into a wait, for example, by watching a queue for jobs issued by the main process.
Hope this helps!
Today I'm after a little tricky situation. I have been using Flask-socketio process based on eventlet. To do so, I need to monkey-patch the Thread module, the socket and os modules too.
What happens is that I'm running a background thread within the Flask-socketio process that is working fine. Now this thread will create after a while a Process (from another script, Process.py) that will be in charge of processing images, and will communicate with it using SimpleQueues. To fecth the images the second process launch a camera thread (picamera) that will be in charge of getting new frames.
Results that picamera uses the standard thread library, so I need to disable the monkey patching and use the standard thread python module within the import of the Process.py, and still use the patched module withing the flask-socketio process. Is it that possible? Is it possible to use different thread module on different process?