Async requests in Flask using Httpx

Recently Flask has introduced async routes in its 2.0 update. This blog is everything about async requests with Flask 2.0. The Flask 2.0 has come up with many interesting updates. Do check out blog of Progress Story for all the updates of Flask 2.0. In this blog, we will be going to learn something about asyncio, aiohttp and async routes of Flask.


We will be covering the below topics in this blog

  • async/await | Asyncio
  • Async routes in Flask
  • Benchmarking

Async requests with Asyncio — async/await

Asyncio is a library to write concurrent code using the async/await syntax. It is used as a foundation for…

A complete guide to production-ready Celery configuration
A complete guide to production-ready Celery configuration

Whenever we work on some heavy data-intensive application or some long-running tasks, it generally slows down the performance of the application, and users have to wait until the task is completed. It was okay in the legacy systems where we used to wait for long to just load some single-page applications.

Long-running tasks side effects

Modern users expect pages to load instantaneously, to solve this we consider many solutions like multiprocessing, multithreading, asynchronous functions using async/await or the Message Queues.

Sonarqube is an automated static code analysis tool configured with Jenkins, it will report bugs, vulnerabilities, and tech debt of the project. Sonarqube with Jenkins can be extensively used to raise the bugs that would be missed by some manual efforts. Secondly, Linting and code coverage are also handled by Sonarqube, so we don’t have to have different tools for that. Thirdly, Sonarqube is open-source software with good support and in this doc, we will be going to cover the setup, sonar scanner for one sonarqube-flask project, integration with Jenkins, and setting up the quality gate.

Consider a situation where…

Flask 2.0 from

Before jumping into Flask 2.0, let’s discuss what is Flask in general. If you are a python geek and know something about webservers, you have definitely heard about Flask or worked on it. Flask is classified as a microframework because it does not require particular tools or libraries and it has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions.

A few days back on 11th May 2021 have released a major stable version of Flask that is Flask 2.0. …

Photo by on

Data lake is a centralized repository that allows you to store all your structured and unstructured data at any scale. You can store your data as-is, without having to first structure the data, and run different types of analytics — from dashboards and visualizations to big data processing, real-time analytics, and machine learning to guide better decisions.

Data in this universe is increasing drastically and it’s estimated that the global datasphere will grow to 175 zettabytes by 2025. Around 90% of the data is mostly unstructured or semi-structured data. …

RabbitMQ Exchange Explained
Rabbitmq Exchanges Explained

Before going ahead with this blog, we should understand the Queuing Systems, RabbitMQ. But if you don't have it, then it's not the end of the world, let me summarize the whole RabbitMQ and Queuing system by taking a simple example.

Treat RabbitMQ as a Post Office

That’s cool right! The Terminal is the most used tool by developers. We spent most of our time in Terminal and sometimes it’s even hard when it comes to using a Mouse and a GUI. Some developers even go the extra mile to supercharge their terminal. So let’s become like those developers.

Let’s not waste our super valuable time and directly dive into the blog!

1. Bpython

is a lightweight Python interpreter that adds several features common to IDEs. These features include syntax highlighting, expected parameter list, auto-indentation, and autocompletion. (See below for example usage).


If you have pip then…

Before diving into the blog, let's clear the air and talk about some of the terms that we are going to use in the blog extensively.

What is Flask Restful?

Flask-RESTful is an extension for Flask that adds support for quickly building REST APIs. Flask-RESTful encourages best practices with minimal setup. If you are familiar with Flask, Flask-RESTful should be easy to pick up.

What is API Documentation?

API documentation is a technical instruction about how to effectively use an API. It’s a concise reference manual containing all the information required to work with the API like the URI, request parameters, functions, classes, return types, arguments and…


Websocket is a communications protocol, providing full-duplex bi-directional communication over a single TCP connection.

To understand Websockets, first, we have to have a clear understanding of HTTP protocol cause both go hand in hand.

Anand Tripathi

Creator of blogging website.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store