Skip to content

Instantly share code, notes, and snippets.

@rafamvc
Created April 13, 2011 00:47
Show Gist options
  • Save rafamvc/916759 to your computer and use it in GitHub Desktop.
Save rafamvc/916759 to your computer and use it in GitHub Desktop.
handle_async exampole
# using handle_async
class TestObj
# All requests coming for #long_background_processing_method will be handled in the background
schedule :every => 30.minutes do
# Code here
end
def method1
# the content of this method will be executed later
end
end
# Method 2 will not be executed in the current server, but it will push
# this request to the queue and will be processed in the background
a = TestObj.new
a.method1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment