On Sun, Feb 06, 2005 at 06:28:57PM -0800, snacktime 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)
In this code, printResult will not be called in a thread.
-Andrew.