Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I seem to use asyncio a lot, so maybe it's just good for internet plumbing. Things I've used it for:

* A Postfix TCP table.

* A milter.

* DNS request forwarding.

* Reading data from a Unix domain socket and firing off dynamic DNS updates.

* A DNS proxy for Redis.

* A netflow agent.

* A stream feeder for Redis.

https://github.com/search?q=user%3Am3047+asyncio&type=Reposi...

By the way you can't use it for disk I/O, but you can try to use it for e.g. STDOUT: https://github.com/m3047/shodohflo/blob/5a04f1df265d84e69f10...

  class UniversalWriter(object):
    """Plastering over the differences between file descriptors and network sockets."""


what about aiofiles[0] for disk I/O?

[0] https://github.com/Tinche/aiofiles


Not sure. A cursory look suggests it runs file ops in a thread pool.

The problem that I'm aware of is at a deeper level and has to do with the ability (or lack thereof) to set nonblocking on file descriptors associated with disk files.


Your look is correct, it basically wraps file i/o in to_thread().




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: