Hi Koriel,
I would be interested to know more about your current setup as I have been trying to achieve something similar recently. IE a flask app which queues tasks and celery running in the background.
The thing im mostly confused about is how the Metashape library deals with the threads as even with just 1 worker it utilises all available cores?
I made Metashape Flask server but what if 100 requests come at the same time? A hundred of depth map, dem or others build will be triggered. This is not efficient. So I separated Metashape's jobs into heavy, middle and light.
Build job belongs to heavy queue.
Export job belongs to middle queue.
Marking and others which occupy a little computing source belong to light queue.
Here, I launch 4 processes (flask app, heavy worker, middle worker, light worker) and I set the number of jobs each worker can process at once.
Heavy: 1
Middle: 20
Light: 100
By this architecture, this is scalable, if you want to assign more computing resources to Metashape Flask app, you can just add one more computer and run three workers which fetches the job from queue(redis) and process.