First, thank you, Ramona, for implementing 'mqueue', and the development team more generally. I got away from 'acc' over the weekend and how use mqueue + rtimer + sqlops for asynchronous CDR logging. Classy!
The question is, there a clean, fast way of checking whether there are more items left in the queue to consume?
I would have thought mq_fetch() would return when there's nothing else left in the queue, but it doesn't; instead, it throws the script into an infinite loop. :-) So, I am using:
route[RECORD_CONSUMER] { while(mq_fetch("somequeue")) {
if(! defined $mqk(somequeue)) break;
# Do things with $mqk(...) and $mqv(...)
} }
Is 'defined' a fast-acting operator within route script? Is there a better way?
On 10/11/2010 05:25 AM, Alex Balashov wrote:
I would have thought mq_fetch() would return when there's nothing else left in the queue
I should clarify: return negatively.
On 10/11/2010 05:28 AM, Alex Balashov wrote:
On 10/11/2010 05:25 AM, Alex Balashov wrote:
I would have thought mq_fetch() would return when there's nothing else left in the queue
I should clarify: return negatively.
I guess master:e6fa8ae004f5d487e1c64471bf282931e4b9e901 answers that. :-) Thanks!