On Mon, Oct 13, 2008 at 2:23 PM, m94asr <m94...@gmail.com> wrote:
> Is there away to find out how many elements are still in a queue?
From a protocol perspective (I'm not too sure how the Ruby library
exposes this), the Queue.DeclareOk response to the Queue.Declare
command returns the queue depth (i.e. the number of messages committed
on ingress). This does not include messages on ingress pending a TX
commit or messages on egress pending acks from consumers. Since this
is an idempotent command, it is currently your best bet from a pure
Ruby perspective.
HTH,
Ben
MQ.queue('crawls').status do |messages, consumers|
puts "#{messages} messages and #{consumers} consumers"
end
Aman
On Mon, Oct 13, 2008 at 6:42 PM, Aman Gupta <themast...@gmail.com> wrote:
> MQ.queue('crawls').status do |messages, consumers|
> puts "#{messages} messages and #{consumers} consumers"
> end
That's what I call syntactic sugar!
+1 to your lib for this :-)
Ben