[Twisted-Python] non-blocking .read

Christopher Armstrong radix at twistedmatrix.com
Wed Apr 2 17:08:46 MST 2003


On Wed, Apr 02, 2003 at 03:34:15PM -0500, Itamar Shtull-Trauring wrote:
> On Wed, 02 Apr 2003 01:13:41 -0600
> Moshe Zadka <moshez at twistedmatrix.org> wrote:
> 
> > It is often convenient in protocol implementations to just .read() as
> > much as you want to. However, it is impossible in Twisted, becase
> > .read() is a blocking operation. Happily, we can make blocking
> > operations seem non-blocking with the use of deferred. The following
> > protocol does just that:
> 
> I suspect it will be waaaaaaaay slower than the equivalent netstring
> implementation.

And way more DEMONIC.

You're a sick man, moshez.

-- 
 Twisted | Christopher Armstrong: International Man of Twistery
  Radix  |          Release Manager,  Twisted Project
---------+     http://twistedmatrix.com/users/radix.twistd/




More information about the Twisted-Python mailing list