Exemplo n.º 1
0
        void HandleOnLeave(IEventSubscription sub)
        {
            var info = sub.GetInfo();

            RemoveSubscriptionFromRedis(info);

            NotifyChannel(sub.Channel, "cmd.onLeave", sub.Meta);
        }
Exemplo n.º 2
0
 void HandleOnUpdate(IEventSubscription sub)
 {
     using (var redis = clientsManager.GetClient())
     {
         StoreSubscriptionInfo(redis, sub.GetInfo());
     }
     NotifyChannels(sub.Channels, "cmd.onUpdate", sub.Meta);
 }
Exemplo n.º 3
0
        public void Register(IEventSubscription sub, Dictionary <string, string> connectArgs = null)
        {
            if (sub == null)
            {
                throw new ArgumentNullException("subscription");
            }

            var info = sub.GetInfo();

            using (var redis = clientsManager.GetClient())
            {
                StoreSubscriptionInfo(redis, info);
            }

            if (connectArgs != null)
            {
                sub.Publish("cmd.onConnect", connectArgs.ToJson());
            }

            local.Register(sub);
        }
Exemplo n.º 4
0
        public void Register(IEventSubscription sub, Dictionary<string, string> connectArgs = null)
        {
            if (sub == null)
                throw new ArgumentNullException("subscription");

            var info = sub.GetInfo();
            using (var redis = clientsManager.GetClient())
            {
                StoreSubscriptionInfo(redis, info);
            }

            if (connectArgs != null)
                sub.Publish("cmd.onConnect", connectArgs.ToJson());

            local.Register(sub);
        }
Exemplo n.º 5
0
        void HandleOnLeave(IEventSubscription sub)
        {
            var info = sub.GetInfo();
            RemoveSubscriptionFromRedis(info);

            NotifyChannels(sub.Channels, "cmd.onLeave", sub.Meta);
        }
Exemplo n.º 6
0
 void HandleOnUpdate(IEventSubscription sub)
 {
     using (var redis = clientsManager.GetClient())
     {
         StoreSubscriptionInfo(redis, sub.GetInfo());
     }
     NotifyChannels(sub.Channels, "cmd.onUpdate", sub.Meta);
 }