On Wed, Jul 21, 2010 at 4:02 AM, I. E. Smith-Heisters <[email protected]> wrote:
> Been playing with a "wakeup" participant to no avail. It suffers from
> the same problem as #on_reply in that it resumes the waiting thread
> before the next storage participant has received the workitem.
>
> Polling doesn't work because I can't find a good interface for asking
> the worker "do you have more work to do?". I had thought
> Worker#inactive? would do this, but it will return false as long as
> there are wfids in the DB.

Hello,

you could do something like

  def idle?
    7.times do
      Thread.pass
      return false if @context.storage.get_msgs.size > 0
    end
    true
  end

But I'm afraid it's a bit brittle (there could be schedules kicking in
a bit later).

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