Ejemplo 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); };
         }
     }
 }
Ejemplo 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); };
         }
     }
 }