On Thu, Oct 1, 2009 at 5:19 AM, Charles.Magid <[email protected]> wrote: > > 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.
Hello Charles, Sorry, I won't reply directly to your question. I will just try to provide a context, it could be useful since you're calling for an example. scenario 1) 'notification' (participant only) - process instance reaches participant expression - participant expression calls consume() of AmqpParticipant instance - workitem is placed on queue - on the other side, workitem is fetched by the "real participant" - on the ruote side, the AmqpParticipant immediately replies to the participant expression, the flow resumes immediately - real participant does something with the workitem (especially with its payload) scenario 2) 'forth and back' (participant and listener) - process instance reaches participant expression - participant expression calls consume() of AmqpParticipant instance - workitem is placed on queue - on the other side, workitem is fetched by the "real participant" - on the ruote side, the participant expression is waiting (is waiting for its reply() method to get called) - real participant does something with the workitem (especially with its payload) - after a while the real participant places a reply (the modified workitem) on the queue dedicated for the AmqpListener - the AmqpListener in the ruote engine fetches the workitem on its queue, locates the expression waiting for it (thanks to the @fei workitem instance variable) and calls the reply() method of that expression with the workitem as parameter - that participant expression replies to its parent expression, flow resumes scenario 3) 'launch that' (listener only) - AmqpListener receives item on the queue it listens to, it's a launchitem, not a workitem - AmqpListener calls engine.launch to start new process instance with the info held in launchitem I hope this will help, best regards, -- John Mettraux - http://jmettraux.wordpress.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
