8

Creating Coroutines, Events, and Message-Driven Transactions

The FastAPI framework is an asynchronous framework that runs over the asyncio platform, which utilizes the ASGI protocol. It is well known for its 100% support for asynchronous endpoints and non-blocking tasks. This chapter will focus on how we create highly scalable applications with asynchronous tasks and event-driven and message-driven transactions.

We learned in Chapter 2, Exploring the Core Features, that Async/Await or asynchronous programming is a design pattern that enables other services or transactions to run outside the main thread. The framework uses the async keyword to create asynchronous processes that will run on top of other thread pools and will be awaited, instead ...

Get Building Python Microservices with FastAPI now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.