Concurrent requests Flask python -
i have flask
application. works database, i'm using sqlalchemy
this. have 1 question:
flask handle requests one-by-one. so, example, have 2 users, modifying same record in table of database, example , b (they concurrent).
how can user b user has changed record? must message user b.
in development server version, when app.run()
, single synchronous process, means @ 1 requests being processed @ time. cannot accept multiple users @ same time.
however, gunicorn solid, easy-to-use wsgi server let spawn multiple workers (separate processes), , comes asynchronous workers when need deploy application.
however, answer question, since, run on separate threads, data exists in database @ specific time when query run in thread used/returned.
i hope answers query.
Comments
Post a Comment