Ejemplo n.º 1
0
 /// <summary>
 /// It executes steps needed when closing the instance
 /// </summary>
 /// <exception cref="System.NotImplementedException"></exception>
 protected override void OnClosing()
 {
     MessageReceiver.FeedMessageReceived -= OnMessageReceived;
     MessageReceiver.FeedMessageDeserializationFailed -= OnMessageDeserializationFailed;
     _messageProcessor.MessageProcessed -= OnMessageProcessed;
     MessageReceiver.Close();
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Closes the current instance
 /// </summary>
 /// <exception cref="InvalidOperationException">Current FeedSystemSession is already closed</exception>
 public void Close()
 {
     if (Interlocked.CompareExchange(ref _isOpened, 0, 1) == 0)
     {
         throw new InvalidOperationException("Current FeedSystemSession is already closed");
     }
     _messageReceiver.FeedMessageReceived -= OnFeedMessageReceived;
     _messageReceiver.FeedMessageDeserializationFailed -= OnFeedMessageDeserializationFailed;
     _messageReceiver.Close();
 }
Ejemplo n.º 3
0
 public void EventsAreNotRaisedAfterTheReceiverIsClosed()
 {
     _messageReceiver.Open(MessageInterest.AllMessages, FeedRoutingKeyBuilder.GetStandardKeys());
     _messageReceiver.Close();
     EventsAreNotRaisedBeforeTheReceiverIsOpened();
 }