Skip to content

Instantly share code, notes, and snippets.

@dylanz
Created November 22, 2017 04:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dylanz/5a0ccb697ffe8ccb0c7be8146f9861db to your computer and use it in GitHub Desktop.
Save dylanz/5a0ccb697ffe8ccb0c7be8146f9861db to your computer and use it in GitHub Desktop.
Lookup a message and process it with Sidekiq
class MessageProcessor
include Sidekiq::Worker
def perform(message_id)
Rails.logger.info("Processing message #{message_id}")
message = Message.find_by_id(message_id)
message.process
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment