spec/jobs.rb in asynchronic-0.2.3 vs spec/jobs.rb in asynchronic-0.3.0
- old
+ new
@@ -191,6 +191,17 @@
class UseReferenceJob < Asynchronic::Job
def call
params[:number] + 1
end
end
+end
+
+class WithRetriesJob < Asynchronic::Job
+ def call
+ @counter = 0
+ retry_when [RuntimeError] do
+ @counter += 1
+ raise 'Counter < 3' if @counter < 3
+ @counter
+ end
+ end
end
\ No newline at end of file