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(); }
protected virtual void Dispose(bool disposing) { if (!_disposed) { _disposed = true; if (disposing) { niftyClient?.Dispose(); niftyClient = null; } } }