Asyncio: Limiting Concurrency With Batches
Exploring how to to write Python programs that leverage concurrency, but without stressing other components, like external APIs or other micro services. Using
asyncio.gather()
and itertools.batched()
data can be processed in batches of fixed size, allowing us to find the right balance between performance, system load and other constraints.