Using Asyncio in Python

Book description

None

Table of contents

  1. Preface
    1. Conventions Used in This Book
    2. O’Reilly Online Learning
    3. How to Contact Us
    4. Acknowledgments
  2. 1. Introducing Asyncio
    1. The Restaurant of ThreadBots
    2. Epilogue
    3. What Problem Is Asyncio Trying to Solve?
  3. 2. The Truth About Threads
    1. Benefits of Threading
    2. Drawbacks of Threading
    3. Case Study: Robots and Cutlery
  4. 3. Asyncio Walk-Through
    1. Quickstart
    2. The Tower of Asyncio
    3. Coroutines
      1. The New async def Keywords
      2. The New await Keyword
    4. Event Loop
    5. Tasks and Futures
      1. Create a Task? Ensure a Future? Make Up Your Mind!
    6. Async Context Managers: async with
      1. The contextlib Way
    7. Async Iterators: async for
    8. Simpler Code with Async Generators
    9. Async Comprehensions
    10. Starting Up and Shutting Down (Gracefully!)
      1. What Is the return_exceptions=True for in gather()?
      2. Signals
      3. Waiting for the Executor During Shutdown
  5. 4. 20 Asyncio Libraries You Aren’t Using (But…Oh, Never Mind)
    1. Streams (Standard Library)
      1. Case Study: A Message Queue
      2. Case Study: Improving the Message Queue
    2. Twisted
    3. The Janus Queue
    4. aiohttp
      1. Case Study: Hello World
      2. Case Study: Scraping the News
    5. ØMQ (ZeroMQ)
      1. Case Study: Multiple Sockets
      2. Case Study: Application Performance Monitoring
    6. asyncpg and Sanic
      1. Case Study: Cache Invalidation
    7. Other Libraries and Resources
  6. 5. Concluding Thoughts
  7. A. A Short History of Async Support in Python
    1. In the Beginning, There Was asyncore
    2. The Path to Native Coroutines
  8. B. Supplementary Material
    1. Cutlery Example Using Asyncio
    2. Supplementary Material for News Website Scraper
    3. Supplementary Material for the ZeroMQ Case Study
    4. Database Trigger Handling for the asyncpg Case Study
    5. Supplementary Material for the Sanic Example: aelapsed and aprofiler
  9. Index

Product information

  • Title: Using Asyncio in Python
  • Author(s):
  • Release date:
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: None