README.rdoc in backgrounded-2.0.0.pre2 vs README.rdoc in backgrounded-2.0.0.rc1
- old
+ new
@@ -6,12 +6,13 @@
= Features
* clean and concise API which removes any dependency on external "worker" jobs and allows you to execute any model method in the background
* integrates with any background processing framework (DelayedJob, Resque, JobFu, Workling, etc)
* background methods can be actually unit tested by using an 'in process' runner
+* custom callbacks to execute ActiveRecord callbacks in the background after being committed to the database
-= Usage
+= General Usage
class User
def do_stuff
end
def self.do_something_else
@@ -22,9 +23,23 @@
# execute instance method in background
user.backgrounded.do_stuff
# execute class method in background
User.backgrounded.do_something_else
+
+= after_commit_backgrounded Callback
+
+Automatically execute a callback in the background after a model has been saved to the database. All of the standard after_commit options are
+available as well as an optional :backgrounded option which will be passed to the Backgrounded::Handler.
+
+ class User < ActiveRecord::Base
+ # execute :do_something in the background after committed
+ after_commit_backgrounded :do_something
+
+ # execute :do_something_else in the background after committed
+ # passing custom options to the backgrounded handler
+ after_commit_backgrounded :do_something_else, :backgrounded => {:priority => :high}
+ end
= Installation
Bundler Gemfile configuration