README.rdoc in backgrounded-2.0.0 vs README.rdoc in backgrounded-2.1.0
- old
+ new
@@ -26,11 +26,11 @@
# 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
+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
@@ -46,23 +46,28 @@
gem 'backgrounded'
= Configuration
-Backgrounded packages handlers for popular frameworks in separate gems. Just drop in the gem for your particular framework or write your own!
+Backgrounded handlers are available for popular libraries in separate gems. Just drop in the gem for your particular framework or write your own!
== Resque
see http://github.com/wireframe/backgrounded-resque
== JobFu
see http://github.com/jnstq/job_fu/tree
== Custom Handlers
+Writing a custom handler is as simple as:
# config/initializers/backgrounded.rb
class MyHandler
- def request(object, method, *args)
- #process the call however you want!
+ # @param object is the target object to invoke the method upon
+ # @param method is the requested method to call
+ # @param args is the optional list of arguments to pass to the method
+ # @param options is the optional hash of options passed to the backgrounded call
+ def request(object, method, args, options={})
+ # process the call however you want!
end
end
Backgrounded.handler = MyHandler.new
== Copyright