Skip to content

Instantly share code, notes, and snippets.

@jsierles
Created November 1, 2018 21:10
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 jsierles/fdbca06a1dcbdb1afa3999820fd62290 to your computer and use it in GitHub Desktop.
Save jsierles/fdbca06a1dcbdb1afa3999820fd62290 to your computer and use it in GitHub Desktop.
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