Last active
December 18, 2015 03:19
-
-
Save kidpollo/5717758 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PostCallbacks | |
def after_create | |
MagicBus::PostStream.new(self, 'create').enqueue | |
end | |
def after_update | |
MagicBus::PostStream.new(self, 'update').enqueue | |
end | |
def after_destroy | |
MagicBus::PostStream.new(self, 'delete').enqueue | |
end | |
end | |
module MagicBus | |
class PostStream < Stream | |
def enqueue | |
LegacyProcessor.enqueue_for_topic(@record, @event) | |
MagicBus.queue.push( | |
PostActivityProcessor.new(@message) | |
) | |
MagicBus.queue.push( | |
ElasticsearchIndexProcessor.new(@message) | |
) | |
MagicBus.queue.push( | |
IntegrationsProcessor.new(@message) | |
) | |
MagicBus.queue.push( | |
NotificationsProcessor.new(@message) | |
) | |
MagicBus.queue.push( | |
StatsProcessor.new(@message) | |
) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment