Beispiel #1
0
        ConnectHandle IConsumerConnector.ConnectConsumer <TConsumer>(IConsumePipeConnector consumePipe, IConsumerFactory <TConsumer> consumerFactory,
                                                                     IPipeSpecification <ConsumerConsumeContext <TConsumer> >[] pipeSpecifications)
        {
            var handles = new List <ConnectHandle>();

            try
            {
                foreach (IConsumerMessageConnector connector in _connectors)
                {
                    ConnectHandle handle = connector.ConnectConsumer(consumePipe, consumerFactory, pipeSpecifications);

                    handles.Add(handle);
                }

                return(new MultipleConnectHandle(handles));
            }
            catch (Exception)
            {
                foreach (ConnectHandle handle in handles)
                {
                    handle.Dispose();
                }
                throw;
            }
        }
Beispiel #2
0
        public ConnectHandle ConnectSaga <T>(IConsumePipeConnector consumePipe, ISagaRepository <T> sagaRepository,
                                             params IPipeSpecification <SagaConsumeContext <T> >[] pipeSpecifications)
            where T : class, ISaga
        {
            var handles = new List <ConnectHandle>();

            try
            {
                foreach (ISagaMessageConnector connector in _connectors)
                {
                    ConnectHandle handle = connector.ConnectSaga(consumePipe, sagaRepository, pipeSpecifications);

                    handles.Add(handle);
                }

                return(new MultipleConnectHandle(handles));
            }
            catch (Exception)
            {
                foreach (ConnectHandle handle in handles)
                {
                    handle.Dispose();
                }
                throw;
            }
        }
Beispiel #3
0
 public void Dispose()
 {
     Log.Info("Start Dispose DataBus");
     _receiveHandle.Disconnect();
     _receiveHandle.Dispose();
     _consumeHandle.Disconnect();
     _consumeHandle.Dispose();
     _busControl.Stop();
     Log.Info("DataBus Disposed");
 }
Beispiel #4
0
        public ConnectHandle Connect(IConsumePipeConnector bus)
        {
            var handles = new List <ConnectHandle>();

            try
            {
                foreach (IConsumerConfigurator configure in _configures)
                {
                    ConnectHandle handle = configure.Connect(bus);

                    handles.Add(handle);
                }

                return(new MultipleConnectHandle(handles));
            }
            catch (Exception)
            {
                foreach (ConnectHandle handle in handles)
                {
                    handle.Dispose();
                }
                throw;
            }
        }
 public void Dispose()
 {
     _handle.Dispose();
 }
Beispiel #6
0
 public void Dispose()
 {
     _registration.Dispose();
     _handle.Dispose();
 }
 public void Dispose()
 {
     _limit?.Dispose();
     _handle?.Dispose();
 }
Beispiel #8
0
 public void Dispose()
 {
     _observer.OnCompleted();
     _handle.Dispose();
 }