Module: Ruote::Resque::Job
- Defined in:
- lib/ruote/resque/job.rb
Overview
Include this module inside your Resque jobs to enable them to respond to Ruote.
- Note that the arity should be 1 for the
self.perform
method. - The workitem will be sent as a Hash. (via
Ruote::Workitem#to_h
)
Instance Method Summary collapse
-
#after_perform_reply_to_ruote(workitem) ⇒ void
after_perform hook to send a reply to the Ruote process.
-
#on_failure_reply_to_ruote(exception, workitem) ⇒ void
on_failure hook to send a reply to the Ruote process.
Instance Method Details
#after_perform_reply_to_ruote(workitem) ⇒ void
This method returns an undefined value.
after_perform hook to send a reply to the Ruote process.
25 26 27 |
# File 'lib/ruote/resque/job.rb', line 25 def after_perform_reply_to_ruote(workitem) Ruote::Resque.reply(workitem) end |
#on_failure_reply_to_ruote(exception, workitem) ⇒ void
This method returns an undefined value.
on_failure hook to send a reply to the Ruote process. Will collect the exception details and send them along.
35 36 37 38 39 40 41 42 |
# File 'lib/ruote/resque/job.rb', line 35 def on_failure_reply_to_ruote(exception, workitem) klass = exception.class.to_s = exception. backtrace = exception.backtrace Ruote::Resque.reply(klass, , backtrace, workitem) end |