예제 #1
0
        public void Unsubscribe(string pattern)
        {
            var baseKey = Activator.CreateInstance <T>().BaseKey;

            if (!pattern.StartsWith(baseKey))
            {
                pattern = baseKey + pattern;
            }

            CurrentSubscriber.Unsubscribe("__keyspace@" + DefaultDatabase + "__:" + pattern, SubscriptionTriggeredResponse, CommandFlags.FireAndForget);

            Subscriptions.Remove(pattern);
        }
예제 #2
0
        void IGroupStartContext.StopGroup(string reason)
        {
            StopFlag = true;

            if (CurrentSubscriber != null)
            {
                Logger.Info($"{CurrentSubscriber.GetType()} requested group stop");
            }

            var stopGroupMessage = new GroupMessage(GroupActions.Stop, _groupEntity, null, reason);

            _bus.HandleWatchDogMessage(stopGroupMessage);
        }
        public async Task UnsubscribeAsync(string pattern, SubscriptionTypes subscriptionType = SubscriptionTypes.Keyspace)
        {
            var baseKey = Activator.CreateInstance <T>().BaseKey;

            if (!pattern.StartsWith(baseKey))
            {
                pattern = baseKey + pattern;
            }

            if (subscriptionType == SubscriptionTypes.Keyspace)
            {
                pattern = "__keyspace@" + DefaultDatabase + "__:" + pattern;
            }

            await CurrentSubscriber.UnsubscribeAsync(pattern, SubscriptionTriggeredResponse, CommandFlags.FireAndForget);

            Subscriptions.Remove(pattern);
        }
        public void Subscribe(string pattern, SubscriptionTypes subscriptionType = SubscriptionTypes.Keyspace)
        {
            var baseKey = Activator.CreateInstance <T>().BaseKey;

            if (!pattern.StartsWith(baseKey))
            {
                pattern = baseKey + pattern;
            }

            if (!Subscriptions.Contains(pattern))
            {
                if (subscriptionType == SubscriptionTypes.Keyspace)
                {
                    pattern = "__keyspace@" + DefaultDatabase + "__:" + pattern;
                }

                CurrentSubscriber.Subscribe(pattern, SubscriptionTriggeredResponse, CommandFlags.FireAndForget);

                Subscriptions.Add(pattern);
            }
        }
예제 #5
0
 private static void ValidatePpvSetting(PPV_VOD_SettingsModel expected, CurrentSubscriber actual)
 {
     Assert.AreEqual(expected.PPVPrivilege, actual.PPVPrivilege, "PPVPrivilege does not match");
     Assert.AreEqual(expected.PPVCap, actual.PPVCap, "PPVCape does not match");
     Assert.AreEqual(expected.PPVResetDay.ToString(CultureInfo.InvariantCulture), actual.PPVResetDay, "PPVResetDay does not match");
     Assert.AreEqual(expected.PINRequired, actual.PINRequired, "PinRequired does not match");
     Assert.AreEqual(expected.PIN, actual.PIN, "PIN does not match");
 }