/// <summary>
        /// Constructs a new instance of a <see cref="EventStoreConnection"/>
        /// </summary>
        /// <param name="settings">The <see cref="ConnectionSettings"/> containing the settings for this connection.</param>
        /// <param name="clusterSettings">The <see cref="ClusterSettings" /> containing the settings for this connection.</param>
        /// <param name="endPointDiscoverer">Discoverer of destination node end point.</param>
        /// <param name="connectionName">Optional name of connection (will be generated automatically, if not provided)</param>
        internal EventStoreNodeConnection(ConnectionSettings settings, ClusterSettings clusterSettings, IEndPointDiscoverer endPointDiscoverer, string connectionName)
        {
            Ensure.NotNull(settings, "settings");
            Ensure.NotNull(endPointDiscoverer, "endPointDiscoverer");

            _connectionName = connectionName ?? string.Format("ES-{0}", Guid.NewGuid());
            _settings = settings;
            _clusterSettings = clusterSettings;
            _endPointDiscoverer = endPointDiscoverer;
            _handler = new EventStoreConnectionLogicHandler(this, settings);
        }
        /// <summary>
        /// Constructs a new instance of a <see cref="EventStoreConnection"/>
        /// </summary>
        /// <param name="settings">The <see cref="ConnectionSettings"/> containing the settings for this connection.</param>
        /// <param name="clusterSettings">The <see cref="ClusterSettings" /> containing the settings for this connection.</param>
        /// <param name="endPointDiscoverer">Discoverer of destination node end point.</param>
        /// <param name="connectionName">Optional name of connection (will be generated automatically, if not provided)</param>
        internal EventStoreNodeConnection(ConnectionSettings settings, ClusterSettings clusterSettings, IEndPointDiscoverer endPointDiscoverer, string connectionName)
        {
            Ensure.NotNull(settings, "settings");
            Ensure.NotNull(endPointDiscoverer, "endPointDiscoverer");

            _connectionName     = connectionName ?? string.Format("ES-{0}", Guid.NewGuid());
            _settings           = settings;
            _clusterSettings    = clusterSettings;
            _endPointDiscoverer = endPointDiscoverer;
            _handler            = new EventStoreConnectionLogicHandler(this, settings);
        }
 public EventStorePersistentSubscription(
     string subscriptionId, string streamId,
     Action<EventStorePersistentSubscriptionBase, ResolvedEvent> eventAppeared,
     Action<EventStorePersistentSubscriptionBase, SubscriptionDropReason, Exception> subscriptionDropped,
     UserCredentials userCredentials, ILogger log, bool verboseLogging, ConnectionSettings settings,
     EventStoreConnectionLogicHandler handler, int bufferSize = 10, bool autoAck = true)
     : base(
         subscriptionId, streamId, eventAppeared, subscriptionDropped, userCredentials, log, verboseLogging,
         settings, bufferSize, autoAck)
 {
     _handler = handler;
 }