Esempio n. 1
0
 private void AddCallback(Action <RedisSubscriptionMessage> callback, params string[] channels)
 {
     lock (_callbackDispatchers)
     {
         foreach (var channel in channels)
         {
             RedisSubscriptionDispatcher disp;
             if (!_callbackDispatchers.TryGetValue(channel, out disp))
             {
                 _callbackDispatchers[channel] = disp = new RedisSubscriptionDispatcher();
             }
             disp.MessageReceived += (s, a) => { callback(a.Message); };
         }
     }
 }
Esempio n. 2
0
 private void AddCallback(Action<RedisSubscriptionMessage> callback, params string[] channels)
 {
     lock (_callbackDispatchers)
     {
         foreach (var channel in channels)
         {
             RedisSubscriptionDispatcher disp;
             if (!_callbackDispatchers.TryGetValue(channel, out disp))
                 _callbackDispatchers[channel] = disp = new RedisSubscriptionDispatcher();
             disp.MessageReceived += (s, a) => { callback(a.Message); };
         }
     }
 }