3 ms·
Personally, I've never been able to make async work properly with Python. In Node.js I can schedule enough S3 ListBucket network requests in parallel to use 100
by zdc1 11mo ago
Personally, I've never been able to make async work properly with Python. In Node.js I can schedule enough S3 ListBucket network requests in parallel to use 100% of my CPU core, by just mapping an array of prefixes into an array of ListBucket Promises. I can then do a Promise.all() and let them happen.
In Python there's asyncio vs threading, and I feel there's just too much to navigate to quickly get up and running. Do people just somehow learn this just when they need it? Is anyone having fun here?
- lillecarl 11mo agoYou'd map to asyncio.create_task then asyncio.gather the result to fill your CPU core.
- nikcub 11mo agothe trio library has an excellent tutorial that explains all of these concepts[0] even if you don't use trio and stick to the core python libs it's worth reading: https://trio.readthedocs.io/en/stable/tutorial.html https://trio.readthedocs.io/en/stable/tutorial.html