[Twisted-Python] Wrapping blocking code

Dave Smith dizzyd at jabber.org
Wed Jul 23 14:42:15 MDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Sounds to me like you want to use a deferToThread(...), to pass the 
calls off to the reactor's thread pool so they can run there without 
holding up the reactor's runloop.

See also: 
http://www.itamarst.org/writings/OSCON03/twisted_internet-95.html

Hope that helps. :)

Diz

On Wednesday, Jul 23, 2003, at 10:16 America/Denver, Justin Johnson 
wrote:

> I have some code in my xmlrpc service that executes commands using
> process.py (http://starship.python.net/crew/tmick/).  The service 
> appears
> to block this code, thus only allowing one connection to get any work
> done at a time, at least while the commands are being executed.  
> Should I
> be wrapping this up in a Deferred somehow to avoid blocking?
>
> Slowly but surely this is starting to make sense to me.  Twisted rocks!
>
> Thanks.
> -Justin
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE/HvMnYNE3chVHHsMRAplLAJ0bbnqUGSDkDz3AZPvCNTvOn1T8TgCg8nCd
m830zVM1AnnL3fF76V1WHqY=
=39jf
-----END PGP SIGNATURE-----





More information about the Twisted-Python mailing list