异步文件中写的Python可能吗? [英] Asynchronous file writing possible in python?

查看:206
本文介绍了异步文件中写的Python可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个现有的模块或使用则aio_write写异步Python中的文件,一个简单的方法?我知道通过文件IO自带的Python是所有阻塞这在大多数情况下罚款,但我需要这种特殊情况下写完全不禁止应用程序,或者至少尽可能少。

Is there an existing module or an easy way to use aio_write to write to a file asynchronously in python? I know by file io that comes with Python is all blocking which is fine in most cases, but for this particular case I need writes not to block the application at all, or at least as minimally as possible.

推荐答案

扭曲了的非阻塞文件描述符写道。如果你正在编写异步code,我希望你能使用双绞线,反正。 :)

Twisted has non-blocking writes on file descriptors. If you're writing async code, I'd expect you to be using twisted, anyway. :)

这篇关于异步文件中写的Python可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆