Esempio n. 1
0
 public Task <TClient> CreateClientAsync <TClient>(
     String host,
     int port,
     ThriftClientConfig config = null,
     String clientName         = null,
     ClientSslConfig sslConfig = null,
     IEnumerable <ThriftClientEventHandler> eventHandlers = null)
     where TClient : class
 {
     return(this.CreateClientAsync(host, port, typeof(TClient), config, clientName, sslConfig, eventHandlers)
            .ContinueWith(t => t.Result as TClient));
 }
Esempio n. 2
0
 public Task <TClient> CreateClientAsync <TClient, TChannel>(
     INiftyClientConnector <TChannel> connector,
     ThriftClientConfig config = null,
     String clientName         = null,
     ClientSslConfig sslConfig = null,
     IEnumerable <ThriftClientEventHandler> eventHandlers = null)
     where TClient : class
     where TChannel : INiftyClientChannel
 {
     return(this.CreateClientAsync(connector, typeof(TClient), config, clientName, sslConfig, eventHandlers)
            .ContinueWith(t => t.Result as TClient));
 }
Esempio n. 3
0
 public Task <Object> CreateClientAsync(
     String host,
     int port,
     Type clientType,
     ThriftClientConfig config = null,
     String clientName         = null,
     ClientSslConfig sslConfig = null,
     IEnumerable <ThriftClientEventHandler> eventHandlers = null)
 {
     return(this.CreateClientAsync(
                new FramedClientConnector(host, port, _loggerFactory),
                clientType, config, clientName, sslConfig, eventHandlers));
 }
Esempio n. 4
0
 public ThriftClient(
     ThriftClientManager clientManager,
     Type clientType,
     ThriftClientConfig clientConfig,
     String clientName,
     IEnumerable <ThriftClientEventHandler> eventHandlers = null) :
     this(clientManager,
          clientType,
          clientName,
          clientConfig.ConnectTimeout,
          clientConfig.ReceiveTimeout,
          clientConfig.ReadTimeout,
          clientConfig.WriteTimeout,
          clientConfig.SocksProxy,
          clientConfig.MaxFrameSize,
          clientConfig.SslConfig,
          eventHandlers ?? Enumerable.Empty <ThriftClientEventHandler>())
 {
 }
Esempio n. 5
0
 public Task <Object> CreateClientAsync <TChannel>(
     INiftyClientConnector <TChannel> connector,
     Type clientType,
     ThriftClientConfig config = null,
     String clientName         = null,
     ClientSslConfig sslConfig = null,
     IEnumerable <ThriftClientEventHandler> eventHandlers = null)
     where TChannel : INiftyClientChannel
 {
     config = config ?? new ThriftClientConfig();
     return(this.CreateClientAsync(connector,
                                   clientType,
                                   config.ConnectTimeout,
                                   config.ReceiveTimeout,
                                   config.ReceiveTimeout,
                                   config.WriteTimeout,
                                   config.MaxFrameSize,
                                   clientName,
                                   sslConfig,
                                   eventHandlers,
                                   null));
 }