[Twisted-Python] newbie confusion - puzzling reactor response

K. Richard Pixley rich at noir.com
Fri Feb 12 14:59:44 EST 2010

exarkun at twistedmatrix.com wrote:
> Also, you won't accomplish much by adding a file descriptor for a normal 
> file to the reactor.  Select, poll, etc, will always indicate that such 
> descriptors are both readable and writeable.
Er... on second thought... isn't there still a utility in asynchronous 
file io which yields to the reactor?

It may be always readable/writable, but if I simply read/write, I'll 
block the process for as long as that takes, block on read, block on 
write.  Whereas if I use async io on the descriptor and go through the 
reactor, I'm effectively yielding to the reactor and any other 
actionable descriptors on each loop as well as allowing my reads and 
writes to happen simultaneously.

Or am I missing something?


More information about the Twisted-Python mailing list