Skip to content

Commit

Permalink
add workling handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Sonnek committed Oct 2, 2010
1 parent 2360f3a commit 0627d68
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/backgrounded/handler/workling_handler.rb
@@ -0,0 +1,14 @@
class Backgrounded::Handler::WorklingHandler < Workling::Base
def request(object, method, *args)
options = {
:class => object.class.name,
:id => object.id,
:method => method,
:params => args
}
Backgrounded::Handler::WorklingHandler.async_perform options
end
def perform(options = {})
options[:class].constantize.find(options[:id]).send(options[:method], *options[:params])
end
end

0 comments on commit 0627d68

Please sign in to comment.