Python Forum

Full Version: REST API using flask - limit connection?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I have a REST APi that take a picture , analyze it - and return an answer to the user.
the all process it taking ~ 25 seconds.
how can I limit , and not take another picture until the first work is done?
Hi,

pretty unusual request, as normally the opposite is what is requested.

Anyway, if you run Flask on a single-threaded, single process, not asycncronous server, the server can handle only one request at a time and will block until this request is processed and returned something.

Which server do you currently run your Flask application on?

Gruß, noisefloor