I am trying to start a new thread in Python inside a Flask application. I am doing background work triggered by a request, but I do not need to wait for the work to complete to respond to the request.
Is it possible to ask a flask request in this threat for a request that came? The reason is that our ACL for our database queries (mongoengine before mongoDB) relies on the request user (he grabs it from the request object on the flask) to find out if they have access to the objects and its bloat because the request is not available in the subflow.
Any thoughts would be greatly appreciated.
Here's the pseudo-code of how I'm processing it now, but it doesn't work.
@app.route('/my_endpoint', methods=['POST']) def my_endpoint_handler():
python flask mongoengine
MattoTodd Mar 29 '12 at 19:02 2012-03-29 19:02
source share