is it possible to sleep in the participants?

40 views
Skip to first unread message

jordi

unread,
Aug 2, 2012, 3:38:31 AM8/2/12
to openwfe...@googlegroups.com

I have ruote working with one worker in an independent process using 
 RuoteKit.run_worker Ruote::Sequel::Storage.new(db_settings)

It seems to be working fine in most of my tests.

I am trying to write some tests, to emulate an participant that takes time to finish, I have the following test participant: 

class SlowActivity
  include Ruote::LocalParticipant

  def consume(workitem)
    sleep 50
  end

  def on_cancel
    # empty
  end
end

The problem is that the workflow with this participant will get stuck on this participant forever (I launched 20 minutes ago), I have tested the current participant with  engine.process and through RuoteKit. 

Any light on what may be the problem here?


John Mettraux

unread,
Aug 2, 2012, 3:41:25 AM8/2/12
to openwfe...@googlegroups.com

On Thu, Aug 02, 2012 at 12:38:31AM -0700, jordi wrote:
>
> The problem is that the workflow with this participant will get stuck on
> this participant forever (I launched 20 minutes ago), I have tested the
> current participant with engine.process and through RuoteKit.
>
> Any light on what may be the problem here?

Hello Jordi,

your participant never replies to the engine. It should read:

def on_workitem
sleep 50
reply
end

or

def consume(workitem)
sleep 50
reply_to_engine(workitem)
end


Best regards,

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

jordi

unread,
Aug 2, 2012, 4:03:41 AM8/2/12
to openwfe...@googlegroups.com

Thank you! 
You are absolutely right. It works now.
Reply all
Reply to author
Forward
0 new messages