← Back to team overview

txamqp-user team mailing list archive

Re: Sending from a for loop

 

Hi

On Mon, Aug 10, 2009 at 7:11 AM, Dan Reverri<reverri@xxxxxxxxx> wrote:
> Can anyone suggest a method of sending messages generated from a list
> of values in a such way that the send function is processed
> immediately?
>
> The send() function does not block and if called from within a for
> loop, it will not be processed until after the for loop has completed.

This is a known issue:

https://answers.launchpad.net/txamqp/+question/67725

and related to:

http://twistedmatrix.com/trac/wiki/FrequentlyAskedQuestions#WhydoesittakealongtimefordataIsendwithtransport.writetoarriveattheothersideoftheconnection

I thought that using callFromThread(self.transport.write, data) would
solve that problem, but I'm afraid it didn't. Using callLater(0,
self.transport.write, data) did, but I'm not sure if it's thread-safe,
so I didn't commit that change to the trunk.

Cheers.



Follow ups

References