[Twisted-Python] Twisted and PEP 3148 support

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Jan 11 08:21:51 EST 2011


On 03:10 am, screwtape at froup.com wrote:
>>Futures may call their callbacks in any thread.  So the line:
>> >                 d.fail(e)
>>
>>must instead be something like:
>>
>>                 reactor.callFromThread(d.errback, e)
>
>PEP 3148 says:
># Added callables are called in the order that they were added and are
># always called in a thread belonging to the process that added them.
>
>I assumed that implied some kind of internal .callFromThread() magic;
>I could be wrong.

It just says "a thread", it doesn't say which.  And since there's 
nothing like a reactor in PEP 3148, there's no way Futures could do this 
on their own.

Jean-Paul



More information about the Twisted-Python mailing list