public async Task Subscribe(EventBusSubscription subscription)
        {
            await Task.Yield();

            var key = this.BuildKey(subscription.ClientId, subscription.SubscriptionId);

            if (!this.subscriptions.ContainsKey(key))
            {
                this.subscriptions.Add(key, subscription);
            }
        }
Exemplo n.º 2
0
        public static EventBusSubscription Create(
            string channel,
            string clientId,
            int subscriptionId,
            string operationToExecute,
            object variables,
            LambdaExpression filter,
            GraphQLDocument document)
        {
            var subscription = new EventBusSubscription();

            subscription.OperationToExecute = operationToExecute;
            subscription.Channel            = channel;
            subscription.ClientId           = clientId;
            subscription.SubscriptionId     = subscriptionId;
            subscription.Filter             = filter;
            subscription.Document           = document;
            subscription.Variables          = variables;

            return(subscription);
        }