Created
November 1, 2018 21:10
-
-
Save jsierles/fdbca06a1dcbdb1afa3999820fd62290 to your computer and use it in GitHub Desktop.
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 Pusher; end | |
module GraphQL | |
module Pro | |
class BackgroundSubscriptions < Subscriptions | |
alias :execute_synchronously :execute | |
def execute(sub_id, event, object) | |
SubscriptionUpdateJob.perform_later(sub_id, Base64.encode64(Marshal.dump(event)), object) | |
end | |
class SubscriptionUpdateJob < ApplicationJob | |
def perform(sub_id, event, object) | |
OpencityRailsSchema.subscriptions.execute_synchronously(sub_id, Marshal.load(Base64.decode64(event)), object) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment