0

I am new to Python, so maybe this is a easy question, but I am planning to do an REST API application but I need it to be very fast and allow concurrent queries. Is there a way to do a application Python that allows concurrent execution and each execution responds to an REST API?

I don't know if threads are a way to go in this case? I know threading is not the same as concurrency, but maybe are a solution for this case.

2
  • There are plenty of frameworks for doing REST APIs. All of which will allow concurrent requests. Django or flask are two of the most popular. Commented Jul 6, 2015 at 11:30
  • I saw the frameworks in github.com/vinta/awesome-python#restful-api but I didn't know if they allowed concurrent requests or you must do the concurrent part yourself. Thanks, I guess that answers it :) Commented Jul 6, 2015 at 11:35

1 Answer 1

2

If you use a WSGI compliant framework (or even just plain WSGI as the "framework") then concurrency is handled by the wsgi "container" (apache + mod_wsgi, nginx+gunicorn, whatever) either as threads, processes or a mix of both. All you have to do is write your code so it does support concurrency (ie : no mutable global state etc).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.