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
require 'graphql' | |
require 'securerandom' | |
require 'httparty' | |
class WebhookSubscriptions < GraphQL::Subscriptions | |
def initialize(**args) | |
super | |
# Using concurrent maps to persist events and subscription information | |
# This can be switched for a DATABASE table/columns | |
@events = Concurrent::Map.new { |h, event_id| h[event_id] = [] } |