Skip to content
Snippets Groups Projects
Commit 76d3c000 authored by Alex Reisner's avatar Alex Reisner
Browse files

Add Sidekiq worker example.

parent 3ee0a2b5
No related branches found
No related tags found
No related merge requests found
# This class implements a Sidekiq worker for performing geocoding
# asynchronously. Do something like this in your controller:
#
# if @object.save
# GeocoderWorker.perform_async(@object.id)
# end
#
class GeocoderWorker
include Sidekiq::Worker
def perform(object_id)
object = Object.find(object_id)
object.geocode
object.save!
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment