Also. here is an example of step method for Ruote::Worker that "solved" the
problem. but, if there is an error in participant code (simulate error
scenario), it locks up (for some reasons @sequel cant insert error row in
db). notice that table name is hardcoded in lock/unlock lines. @table was
not accessible outside of @storage scope.
---------------
def step
begin
@storage.sequel.run("LOCK TABLES ruote_documents WRITE")
puts 'locked'
begin_step
@msg = nil
@processed_msgs = 0
determine_state
if @state == 'stopped'
return
elsif @state == 'running'
process_schedules
process_msgs
end
@storage.sequel.run("UNLOCK TABLES")
puts 'unlocked'
take_a_rest # 'running' or 'paused'
rescue => err
puts 'error handling'
@storage.sequel.run("UNLOCK TABLES")
puts 'unlocked'
handle_step_error(err, @msg) # msg may be nil
end
end
--------
--
--
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
---
You received this message because you are subscribed to the Google Groups
"ruote" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.