Exemplo n.º 1
0
 public ThriftClientManager(ThriftCodecManager codecManager, NiftyClient niftyClient, IEnumerable <ThriftClientEventHandler> globalEventHandlers, IThriftClientFactory clientFactory = null, ILoggerFactory loggerFactory = null)
 {
     Guard.ArgumentNotNull(codecManager, nameof(codecManager));
     Guard.ArgumentNotNull(niftyClient, nameof(niftyClient));
     this.niftyClient         = niftyClient;
     this.codecManager        = codecManager;
     this.globalEventHandlers = globalEventHandlers ?? Enumerable.Empty <ThriftClientEventHandler>();
     _loggerFactory           = loggerFactory;
     _logger = loggerFactory?.CreateLogger <ThriftClientManager>() ?? (ILogger)NullLogger.Instance;
     _thriftClientFactory = clientFactory ?? new DynamicProxyClientFactory();
 }
Exemplo n.º 2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!_disposed)
     {
         _disposed = true;
         if (disposing)
         {
             niftyClient?.Dispose();
             niftyClient = null;
         }
     }
 }