On Tue, Nov 08, 2011 at 07:08:23AM -0800, Pedro Teixeira wrote:
>
> What's the requirement for a Wfid Generator? Does the engine rely on proper
> ordering?
> Would a simple:
>
>     def get_raw
>       Time.now.utc + rand
>     end
>
> be ok, for production?

Hello,

that wouldn't work, there could be instances of

  r0 = get_raw
  r1 = get_raw

where

  r0 == r1

Two workflow instances with the same instance ids would be bad.

If you have a unique worker you could do things like

---8<---
def get_raw

  r = Time.now.utc
  @last ||= r
  r = r + 0.001 while r <= @last

  @last = r
end
--->8---

where you don't care about any other workers.

You can also provide your own generator implementation (as written in previous 
emails in this thread) using whatever library you like (uuid, ...), as long as 
there are no workflow instance id collisions.


Kind regards,

--
John Mettraux - http://lambda.io/processi

-- 
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