コード例 #1
0
 public void Register(ExchangeListener exchangeListener)
 {
     lock (_lock) {
         this._exchangeListeners.Add(exchangeListener.Name, exchangeListener);
     }
     this.SendToServer("SUBSCRIBE:" + this._clientId + ":" + exchangeListener.ExchangeName);
 }
コード例 #2
0
        private void SetUp()
        {
            DomainEventPublisher.Instance.Reset();

            SlothServer.ExecuteInProcessDetachedServer();

            Thread.Sleep(500);

            _phoneNumberExecutive = new PhoneNumberExecutive();
            _phoneNumberFinder = new PhoneNumberFinder();
            _matchtedPhoneNumberCounter = new MatchtedPhoneNumberCounter();
            _totalPhoneNumbersCounter = new TotalPhoneNumbersCounter();

            SlothClient.Instance.Register(this._phoneNumberExecutive);
            SlothClient.Instance.Register(this._phoneNumberFinder);
            SlothClient.Instance.Register(this._matchtedPhoneNumberCounter);
            SlothClient.Instance.Register(this._totalPhoneNumbersCounter);

            _publisher = new ExchangePublisher("PhoneNumberExchange");
        }
コード例 #3
0
 public void UnRegister(ExchangeListener exchangeListener)
 {
     lock (_lock) {
         this._exchangeListeners.Remove(exchangeListener.Name);
     }
     this.SendToServer("UNSUBSCRIBE:" + this._clientId + ":" + exchangeListener.ExchangeName);
 }