[Twisted-Python] New user questions

Christopher Armstrong radeex at gmail.com
Sun Feb 6 19:46:32 MST 2005


It's not being called inside a thread; the callbacks of deferToThread
are run in the main thread.


On Sun, 6 Feb 2005 18:28:57 -0800, snacktime <snacktime at gmail.com> wrote:
> I'm having some problems playing with Deferreds and I think it's due
> to using threads.  In the following code, will printResult be called
> in the thread?  printResult is inside the protocol handler for a
> simple echo server, and when calling transport.write it doesn't seem
> to write anything, and I'm wondering if it's because it's being called
> inside a thread?
> 
> d = threads.deferToThread(doLongCalculation)
> d.addCallback(printResult)
> 
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
> 


-- 
  Twisted   |  Christopher Armstrong: International Man of Twistery
   Radix    |    -- http://radix.twistedmatrix.com
            |  Release Manager, Twisted Project
  \\\V///   |    -- http://twistedmatrix.com
   |o O|    |  Founding Member, Hobart Hacking Society
w----v----w-+    -- http://hackingsociety.org/chapters/hash




More information about the Twisted-Python mailing list