Python Forum
REST API using flask - limit connection?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
REST API using flask - limit connection?
#1
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?
Reply
#2
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Flask Rest API - fire and forget MorganSamage 2 1,596 Feb-04-2023, 11:09 AM
Last Post: MorganSamage
  Simple flask rest api problem cancerboi 4 2,837 Jan-29-2020, 03:10 PM
Last Post: brighteningeyes
  Flask rest api How to retrieve json request raysefo 4 6,130 Jan-20-2019, 06:46 PM
Last Post: raysefo
  Python Flask REST API vndywarhol 1 2,995 Sep-28-2018, 12:43 PM
Last Post: thomasp

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020