Skip to content

Instantly share code, notes, and snippets.

@kbighorse
Created February 2, 2012 01:19
Show Gist options
  • Select an option

  • Save kbighorse/1720754 to your computer and use it in GitHub Desktop.

Select an option

Save kbighorse/1720754 to your computer and use it in GitHub Desktop.
resque worker module
class User
# ...
def async_do_work
Resque.enqueue SyftoWorkr, self.id
end
def do_work
puts "User #{self.id}, email #{self.email}"
end
module SyftoWorkr
@queue = :utility
def self.perform(user_id)
user = User.find user_id
user.do_work
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment