Skip to Main Content
Python Concurrency with asyncio
book

Python Concurrency with asyncio

by Matthew Fowler
February 2022
Intermediate to advanced content levelIntermediate to advanced
376 pages
10h 54m
English
Manning Publications
Content preview from Python Concurrency with asyncio

5 Non-blocking database drivers

This chapter covers

  • Running asyncio friendly database queries with asyncpg
  • Creating database connection pools running multiple SQL queries concurrently
  • Managing asynchronous database transactions
  • Using asynchronous generators to stream query results

Chapter 4 explored making non-blocking web requests with the aiohttp library, and it also addressed using several different asyncio API methods for running these requests concurrently. With the combination of the asyncio APIs and the aiohttp library, we can run multiple long-running web requests concurrently, leading to an improvement in our application’s runtime. The concepts we learned in chapter 4 do not apply only to web requests; they also apply to running SQL ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Building Python Microservices with FastAPI

Building Python Microservices with FastAPI

Sherwin John C. Tragura
Python for DevOps

Python for DevOps

Noah Gift, Kennedy Behrman, Alfredo Deza, Grig Gheorghiu

Publisher Resources

ISBN: 9781617298660Supplemental ContentPublisher SupportOtherPublisher WebsiteSupplemental ContentPurchase Link