コード例 #1
0
        public void GivenMessage_WhenDispose_ShouldNotifyObservers()
        {
            var observerMock = new Mock <IObserver <IPublisherMessageBatching> >();

            observerMock.Setup(x => x.OnCompleted())
            .Verifiable();

            var unsubscribe = _publisher.Subscribe(observerMock.Object);

            _publisher.Dispose();

            unsubscribe.Should().NotBeNull();
            observerMock.VerifyAll();
        }
コード例 #2
0
 private void DisposePublisher()
 {
     lock (_publisher)
     {
         _publisher.Dispose();
     }
 }
コード例 #3
0
        public DisposeResponse Dispose(DisposeRequest request)
        {
            _publisher.Dispose(request);

            return(new DisposeResponse()
            {
                Success = true
            });
        }
コード例 #4
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                _publisher.Dispose();
                _subscriber.Dispose();

                _bus.Dispose();
            }

            base.Dispose(disposing);
        }
コード例 #5
0
        public void Dispose()
        {
            foreach (ILayoutWorker lw in _layoutWorkers)
            {
                lw.Dispose();
            }

            foreach (IReleaseVerifier rv in _verifiers)
            {
                rv.Dispose();
            }

            _publisher.Dispose();
            _manifestGenerator.Dispose();
        }
コード例 #6
0
        public override void Dispose()
        {
            logger.Debug("Disposing of requester");

            if (publisher != null)
            {
                logger.Debug(" -> Disposing of publisher");
                publisher.Dispose();
            }

            if (subscription != null)
            {
                logger.Debug(" -> Disposing of subscription");
                subscription.Dispose();
            }

            base.Dispose();
        }
コード例 #7
0
 public void Dispose()
 {
     _publisher?.Dispose();
 }
コード例 #8
0
ファイル: Main.cs プロジェクト: gcheney/Burrows
 public void Dispose()
 {
     _publisher.Dispose();
     Console.WriteLine(new string('-', 20));
     Console.WriteLine("Disposing the Service");
 }
コード例 #9
0
 public void Stop()
 {
     publisher.Dispose();
     subscriber.Dispose();
     bus.Dispose();
 }