Created
April 13, 2011 00:47
-
-
Save rafamvc/916759 to your computer and use it in GitHub Desktop.
handle_async exampole
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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