コード例 #1
0
        public void AddSubscriber(Type messageType, QueueName destination)
        {
            Condition.Requires(messageType, "messageType").IsNotNull();
              Condition.Requires(destination, "destination").IsNotNull();

              SubscriptionRegistration registration;
              if (!Subscriptions.TryGet(messageType, out registration))
            registration = new SubscriptionRegistration();

              if (!registration.SubscriberQueueNames.Any(q => q == destination))
            registration.SubscriberQueueNames.Add(destination.Name);

              Subscriptions.Put(messageType, registration);
        }
コード例 #2
0
        public void AddSubscriber(Type messageType, QueueName destination)
        {
            Condition.Requires(messageType, "messageType").IsNotNull();
            Condition.Requires(destination, "destination").IsNotNull();

            SubscriptionRegistration registration;

            if (!Subscriptions.TryGet(messageType, out registration))
            {
                registration = new SubscriptionRegistration();
            }

            if (!registration.SubscriberQueueNames.Any(q => q == destination))
            {
                registration.SubscriberQueueNames.Add(destination.Name);
            }

            Subscriptions.Put(messageType, registration);
        }