Hello,

I've just had an email exchange with Gonzalo about participants and JRuby :

  http://groups.google.com/group/openwferu-users/t/a91da82aa7927f14

At first, a bit of context.

There are two ways to specify a timeout on a participant, from the process 
definition and from the participant implementation.

---8<---
sequence do
  participant 'gonzalo', :timeout => '2d'
end
--->8---

After two days (well 48 * 3600 seconds), the workitem will be taken back 
(cancelled) for participant Gonzalo.

---8<---
class OvenParticipant
  include Ruote::LocalParticipant

  def consume(workitem)
    cook(workitem.fei.sid, workitem.fields['stuff'])
    reply_to_engine(workitem)
  end

  def cancel(fei, flavour)
    cancel_cook(fei.sid)
  end

  def rtimeout
    '2h'
  end

  protected

  def cook
    # ...
  end
  def cancel_cook
    # ...
  end
end
--->8---

Our oven participant trusts ruote for cancelling cooking operations after two 
hours.

In the upcoming 2.1.12, I'll probably allow passing the workitem to the 
#rtimeout method for more specific timeout computations.

So, if any of you out there uses Participant#timeout, please switch to 
Participant#rtimeout when you upgrade.


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

Reply via email to