Comment

Comment by btreecat

>I did this for two reasons, the first being that I cannot, for the life of me, figure out how to use asyncio to do local file IO and not a network request, but maybe I'm just an idiot.

I don't think you are an idiot I just think you didn't search well enough. There is a reason there is no local file IO with asyncio.

Check these links for more info:

* https://stackoverflow.com/questions/87892/what-is-the-status...

* http://blog.libtorrent.org/2012/10/asynchronous-disk-io/

From what I understand the way libuv (what node.js uses) gets around OS limits is with a thread pool.

Also, this documentation might be helpful:

* https://docs.python.org/3.5/library/asyncio-dev.html#handle-...

My experiences don't seem to mirror your frustration. I found asyncio quite useful for tinkering with a simple web scraper that hit multiple sites at once (each with a different response time) and munged all the data together into one data set.

Thanks for the write-up!

parent btreecat 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton