OpsMill’s Post

If your Python scripts are making 50 API calls, synchronous code spends most of its time waiting around doing absolutely nothing. Suresh Vina has written an intro to async Python using a simple analogy: boiling a kettle and making toast at the same time. Sync code does one, then the other. Async runs both concurrently. Same two tasks: 5 seconds sync, 3 seconds async. It’s not a big deal when making breakfast. But scale that concept across dozens of API calls and the difference adds up. The Infrahub Python SDK supports both sync and async natively. Switching between them is simple. Suresh walks through the core concepts, shows side-by-side code examples, and builds up to running the same operation across multiple sites concurrently. If async Python has been sitting on your "I should learn that someday" list, now’s your chance to *get up to speed*. (See what we did there? 😉) Link in comments 👇

  • No alternative text description for this image

How to write scripts that reduce wait times using async Python: https://opsmill.com/blog/async-python-basics/

To view or add a comment, sign in

Explore content categories