3 ms·
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 forward
by m3047 4y ago
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=Repositories 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/5a04f1df265d84e69f10af674709af06202546e3/examples/dnstap2json.py#L263 https://github.com/m3047/shodohflo/blob/5a04f1df265d84e69f10...
class UniversalWriter(object):
"""Plastering over the differences between file descriptors and network sockets."""
- gilad 4y agowhat about aiofiles[0] for disk I/O? [0] https://github.com/Tinche/aiofiles https://github.com/Tinche/aiofiles
- m3047 4y agoNot 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.
- nerdponx 4y agoYour look is correct, it basically wraps file i/o in to_thread().