What is the best way to run long running task, but that returns response to a client in the same session? #4684
Unanswered
martinenkoEduard
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not very familliar with flask.
I need to run long running tasks (mostly requests to REST API)
But for simplicity I want to return response in the same sessions.
So without queques like celery and rabbitMQ.
What is the proper way to do this.
For instance:
How do I improve this?
considering that
collection.search(**search_param) and detection.detect(image_path) can take a while.
And where do I need to put connection to databases and so on?
After app = Flask(name)
or
inside
@app.route('/')
def hello():
Beta Was this translation helpful? Give feedback.
All reactions