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; } }
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; } }
public void Dispose() { Log.Info("Start Dispose DataBus"); _receiveHandle.Disconnect(); _receiveHandle.Dispose(); _consumeHandle.Disconnect(); _consumeHandle.Dispose(); _busControl.Stop(); Log.Info("DataBus Disposed"); }
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(); }
public void Dispose() { _registration.Dispose(); _handle.Dispose(); }
public void Dispose() { _limit?.Dispose(); _handle?.Dispose(); }
public void Dispose() { _observer.OnCompleted(); _handle.Dispose(); }