Ejemplo n.º 1
0
        public async Task<BrokerConnection> GetOpenConnectionFor(BrokerMetadata broker)
        {

            var connection = _Connections.GetOrAdd(broker.NodeId, x => CreateConnectionFor(broker));
            await connection.AssertOpen();
            return connection;
        }
Ejemplo n.º 2
0
 public BrokerConnection(BrokerMetadata brokerConfig)
 {
     _BrokerConfig = brokerConfig;
     _Client = new TcpClient();
 }
Ejemplo n.º 3
0
 private BrokerConnection CreateConnectionFor(BrokerMetadata broker)
 {
     return new BrokerConnection(broker);
 }
Ejemplo n.º 4
0
 private Task<MetadataResponse> GetMetadataTask(BrokerMetadata config)
 {
     return _BrokersConnectionPool
         .GetOpenConnectionFor(config)
         .ContinueWith(y => y.Result.SendAndReturn(MetadataRequest.ForAll).Result as MetadataResponse);
 }