[rabbitmq-discuss] RabbitMQ Usage Patterms?
simone.busoli at gmail.com
Tue Jul 19 00:51:16 BST 2011
A common way to go is to have a thread - or whathever your environment calls
it - running in parallel to your application code, listening for messages
arriving from RabbitMQ and dispatching them to your application.
On Jul 19, 2011 1:45 AM, "Shalom Rav" <csharpplusproject at gmail.com> wrote:
> I have gone through the 'Get Started' examples on the RabbitMQ
> While the examples are good, it looks like they are all similar --
> having the 'app' part of the code (a function call, a task etc)
> *embedded* within the messages consumer.
> In other words, using *channel.start_consuming()* we continuously WAIT
> for messages to arrive; As soon as a message is consumed (--> *** in
> response to the message's consumption *** <--) we do something (this
> is the 'app').
> This pattern is basically having the 'app' *embedded* within the
> consumer. An 'app' will ONLY work in response to a message that was
> being consumed.
> What about the other way around -- can we have the messages *embedded*
> within an 'app'?
> In other words, is it possible to simply code up our app (say, a
> class) in the usual way, and, whenever we want to receive a message,
> simply include that code where we want to?
> In such a scenario, our script will spend most of its time running our
> app. When a certain condition is met (and ONLY then), we will invoke a
> call to rabbitMQ to receive a message from a queue.
> Does it make sense? Are there any python code samples that
> demonstrate this approach?
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss