← Back to team overview

txamqp-user team mailing list archive

Sending from a for loop

 

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.

Here is an example script that shows the issue:
http://pastie.org/pastes/578092


The results of the script are:
sending: 0
sending: 1
sending: 2
sending: 3
sending: 4
sending: 5
sending: 6
sending: 7
sending: 8
sending: 9
receiving: 0
receiving: 1
receiving: 2
receiving: 3
receiving: 4
receiving: 5
receiving: 6
receiving: 7
receiving: 8
receiving: 9


Thanks for any advice,
Dan



Follow ups