aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/CHANGELOG.md
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2016-08-02 15:04:45 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2016-08-02 15:04:45 -0700
commitb53da9e90b697d5ed648e34db1ed9219d2f2feb9 (patch)
tree5d11146560fd2be78cc175b963b9782c681e4098 /activejob/CHANGELOG.md
parent7efd77fae58a02c6014211a8f2f9bcce3f4844cc (diff)
downloadrails-b53da9e90b697d5ed648e34db1ed9219d2f2feb9.tar.gz
rails-b53da9e90b697d5ed648e34db1ed9219d2f2feb9.tar.bz2
rails-b53da9e90b697d5ed648e34db1ed9219d2f2feb9.zip
Amend the CHANGELOG
Diffstat (limited to 'activejob/CHANGELOG.md')
-rw-r--r--activejob/CHANGELOG.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/activejob/CHANGELOG.md b/activejob/CHANGELOG.md
index 5e72c67aea..39503caeea 100644
--- a/activejob/CHANGELOG.md
+++ b/activejob/CHANGELOG.md
@@ -1,2 +1,23 @@
+## Rails 5.1.0.alpha ##
+
+* Added declarative exception handling via ActiveJob::Base.retry_on and ActiveJob::Base.discard_on.
+
+ Examples:
+
+ class RemoteServiceJob < ActiveJob::Base
+ retry_on CustomAppException # defaults to 3s wait, 5 attempts
+ retry_on AnotherCustomAppException, wait: ->(executions) { executions * 2 }
+ retry_on ActiveRecord::StatementInvalid, wait: 5.seconds, attempts: 3
+ retry_on Net::OpenTimeout, wait: :exponentially_longer, attempts: 10
+ discard_on ActiveJob::DeserializationError
+
+ def perform(*args)
+ # Might raise CustomAppException or AnotherCustomAppException for something domain specific
+ # Might raise ActiveRecord::StatementInvalid when a local db deadlock is detected
+ # Might raise Net::OpenTimeout when the remote service is down
+ end
+ end
+
+ *DHH*
Please check [5-0-stable](https://github.com/rails/rails/blob/5-0-stable/activejob/CHANGELOG.md) for previous changes.