Best Practices to Asynchronously Send Information to Two APIs Without Blocking?

18 Replies, 1167 Views

Wow, thanks everyone for the awesome suggestions! I tried using `asyncio.gather()` with `aiohttp` in Python, and it worked like a charm for asynchronously sending information to two APIs. I also added `tenacity` for retries, and it’s been super helpful.

I’m still figuring out the rate limit stuff, though. I’ll check out `aiolimiter` and `bottleneck`—those sound like exactly what I need.

One quick follow-up: how do you guys handle timeouts? I’ve been setting a global timeout, but I’m not sure if that’s the best approach. Any tips?

Thanks again, y’all are the best!

Messages In This Thread



Users browsing this thread: 1 Guest(s)