What would be the best choice for integrating a real-time connection in flask API?
I think today's default solution to provide realtime capabilities for web applications are websockets (Please google Flask+websockets). If concurrency is an issue (i.e. many long-lasting, simultaneous connections), the "chain" of software handling the websockets should be non-blocking (otherwise many threads will eat up your resources while doing nothing). You can continue to use flask, as it supports gevent (a non-blocking monkey-patch for the Python stdlib), but your are probably better off with nginx than Apache as the reverse proxy since it has always been non-blocking. For example, nginx+gevent+flask would provide you a nonblocking setup.
Personally, I like Tornado a lot, but I would be reluctant to introduce another framework into your application if you already went a long way with Flask.
Currently we have developed an API using Flask that works in a traditional request-response style (client is a mobile application). This API is hosted using Apache on the remote server. What we would like to do is integrate the real-time connections between server and client (just like a chat app). This is where I got stuck. I need to make choice for the framework here. Using Tornado with Flask will not be a good choice since Tornado is non-blocking but Flask is blocking. What would be the best choice in this case?