Skip to content

@npj /gist:2863154
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# app/models/my_model.rb
class MyModel < ActiveRecord::Base
def async_background_method(arg1, arg2)
Queue::Normal.enqueue(self, :background_method, arg1, arg2)
end
# this happens in the background,
def background_method(arg1, arg2)
# do something that takes a long time...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.