Created
November 22, 2017 04:23
-
-
Save dylanz/5a0ccb697ffe8ccb0c7be8146f9861db to your computer and use it in GitHub Desktop.
Lookup a message and process it with Sidekiq
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
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