private Func <IConnection> CreateConnection(RabbitMQOptions options)
        {
            var factory = new ConnectionFactory {
                HostName    = options.HostName,
                VirtualHost = options.VirtualHost,
                UserName    = options.UserName,
                Password    = options.Password,
                RequestedConnectionTimeout = options.RequestedConnectionTimeout,
                SocketReadTimeout          = options.SocketReadTimeout,
                SocketWriteTimeout         = options.SocketWriteTimeout,
                AutomaticRecoveryEnabled   = options.AutomaticRecoveryEnabled
            };

            return(() => factory.CreateConnection());
        }
 public ConnectionChannelPool(RabbitMQOptions options)
 {
     maxSize             = defaultSize;
     connectionActivator = CreateConnection(options);
 }