Good Day

Could you please validate my understanding of ruote-amqp, and possible
provide another example or two.  Thank you very much in advance.

In general there are three ways to get information from an AMQP queue.

1) Blocking

Wait for information until it is available.  IE the instruction
pointer does not advance

2) Non Blocking

See if there is a message on the queue but keep executing.

3) Asynchronous call back.  There is a jump to a completely different
method which will be handed the message from the queue when any
message is available.

I was looking  at the ruote-amqp/spec/listener_spec.rb rspec file as a
model for my code.

The example seems to use two of the above mechanisms but I would like
some clarification of the asynchronous call back method.

My understanding of how to deque from amqp using the ruote-amqp gem.

1)  "loop do ... break unless @msg.nil? ... sleep 0.1 ... end" is
added to do blocking in conjunction with the Non blocking statement in
2).

2) "MQ.queue('test3').subscribe { |msg| @msg = ... }"  keeps taking
messages off of test3 que until there are no messages there to be
taken off.

3) It seems that "@engine.register_listener( RuoteAMQP::Listener )" is
registering an asynchronous call back.   Though I am not sure how this
works.

The register_participant example in RuoteAMQP::Participant was very
funny.  I would like to see a simple example, using ruote 2.0, to
illustrate the use of asynchronous listeners.


Thank you very much in advance,

Charles M


--~--~---------~--~----~------------~-------~--~----~
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to