Beispiel #1
0
 public EventSubscription()
 {
     Token = new MessageSubscriptionToken()
     {
         Token = Guid.NewGuid()
     };
 }
Beispiel #2
0
 /// <summary>
 /// Unsubscribe from a message
 /// </summary>
 /// <param name="token">Subscription to unsubscribe</param>
 public void Unsubscribe(MessageSubscriptionToken token)
 {
     lock (_lock)
     {
         var sub = _subscriptions.SingleOrDefault(s => s.Token == token);
         if (sub != null)
         {
             _subscriptions.Remove(sub);
             sub.Dispose();
         }
     }
 }