[Twisted-Python] writing back to the connection is blocking my code

coder_gus coder_gus at lavabit.com
Thu Mar 20 04:23:16 EDT 2008


Ok, this link answered a few of my questions (stupid of me that I 
haven't looked on that before I posted), but my question still stands: 
how do I send data to a client whenever I want from wherever I want and 
that data to be send as fast as possible, without the code waiting for 
the reactor to answer to some events? Sorry for being too pushy but I am 
not getting the picture right and I really want to get what's going on 
with this.

Thanks.

glyph at divmod.com wrote:
>
> On 03:03 pm, coder_gus at lavabit.com wrote:
>> Hi,
>> I have a server that tries to write back to several clients after it 
>> processed some that. I keep a hash with the currently connected 
>> clients (protocol instances) and write back to those as soon as the 
>> workers finish their job. The thing is I don't know where to call 
>> that instance.writeDataToClient() to not block my code. (I have tried 
>> in buildProtocol, but of course, it waits that another connection to 
>> be made until it writes back).
>
> It sounds like you might be having a problem answered by this FAQ 
> question:
>
> http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#HowdoImakeTwistedtalktomultipleclientsconnecttomultipleservers 
>
> or perhaps the following one.
>>
>> Thanks for All your help.
>>
>>
>> _______________________________________________
>> Twisted-Python mailing list
>> Twisted-Python at twistedmatrix.com
>> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
> ____________________________________________________________________________________ 
>
> Click for quotes on adjustable mortgages.
> http://ads.lavabit.com/fc/REAK6bkMOiFnNX2sGS485h9324PbTgrM9xKyt0ZhxqimEnvQxvSm9X/ 
>
> ____________________________________________________________________________________ 
>





More information about the Twisted-Python mailing list