[Twisted-Python] Re: callFromThread [was Hilarious dream-logic]

Johann Borck johann.borck at densedata.com
Thu May 18 20:46:54 EDT 2006


Scott Lamb wrote:

> On May 18, 2006, at 2:34 PM, glyph at divmod.com wrote:
>
>> I understand that English isn't your first language, and I don't 
>> blame you for that, but you can find the documentation for these 
>> APIs here:
>>
>> http://twistedmatrix.com/documents/current/api/
>> twisted.internet.interfaces.IReactorThreads.html
>>
>> and I think the descriptions are easy enough to understand.
>
>
> Actually, English is my first language, and I'm confused every time I 
> see those functions...
>
I'm not a native speaker, but given twisteds  concurrency model, how
could one assume reactor.callFromThread gets executed anywhere but in
the reactor? Nothing else makes sense, or put as a question, what else
does?  You call something  f r o m  a  thread, using a member-function
of the one and only reactor. The only way to get that wrong is to think
of the thread in callFromThread as the reactor-thread. The main loop of
an asynchronous app is way too special to name it just thread, thatswhy
its name is reactor, so the other way round it might be
callFrom/InReactor, which imo would make it by far less obvious that
this is an interface to threads.

Johann







More information about the Twisted-Python mailing list