Exemplo n.º 1
0
 public void Unsubscribe(MessageSubscription subs)
 {
     if (_subscriptions.TryRemove(subs, out var s))
     {
         s.Stop();
     }
 }
Exemplo n.º 2
0
        public MessageSubscription AddMessageSubscription(IEnumerable <string> types, Action <MessageBase> action)
        {
            var sub = new MessageSubscription(types, action, _loggerFactory.CreateLogger <MessageSubscription>());

            _subscriptions.GetOrAdd(sub, t => t);
            return(sub);
        }