public PersistentSubscriptionStats(PersistentSubscription parent, PersistentSubscriptionParams settings,
                                    Stopwatch totalTimeWatch)
 {
     _settings       = settings;
     _parent         = parent;
     _totalTimeWatch = totalTimeWatch;
 }
        private void CreateSubscriptionGroup(string eventStreamId,
                                             string groupName,
                                             bool resolveLinkTos,
                                             long startFrom,
                                             bool extraStatistics,
                                             int maxRetryCount,
                                             int liveBufferSize,
                                             int historyBufferSize,
                                             int readBatchSize,
                                             TimeSpan checkPointAfter,
                                             int minCheckPointCount,
                                             int maxCheckPointCount,
                                             int maxSubscriberCount,
                                             string namedConsumerStrategy,
                                             TimeSpan messageTimeout)
        {
            var key = BuildSubscriptionGroupKey(eventStreamId, groupName);
            List <PersistentSubscription> subscribers;

            if (!_subscriptionTopics.TryGetValue(eventStreamId, out subscribers))
            {
                subscribers = new List <PersistentSubscription>();
                _subscriptionTopics.Add(eventStreamId, subscribers);
            }

            var subscription = new PersistentSubscription(
                new PersistentSubscriptionParams(
                    resolveLinkTos,
                    key,
                    eventStreamId,
                    groupName,
                    startFrom,
                    extraStatistics,
                    messageTimeout,
                    maxRetryCount,
                    liveBufferSize,
                    historyBufferSize,
                    readBatchSize,
                    checkPointAfter,
                    minCheckPointCount,
                    maxCheckPointCount,
                    maxSubscriberCount,
                    _consumerStrategyRegistry.GetInstance(namedConsumerStrategy, key),
                    _streamReader,
                    _checkpointReader,
                    new PersistentSubscriptionCheckpointWriter(key, _ioDispatcher),
                    new PersistentSubscriptionMessageParker(key, _ioDispatcher)));

            _subscriptionsById[key] = subscription;
            subscribers.Add(subscription);
        }
 public PersistentSubscriptionStats(PersistentSubscription parent, PersistentSubscriptionParams settings, Stopwatch totalTimeWatch)
 {
     _settings = settings;
     _parent = parent;
     _totalTimeWatch = totalTimeWatch;
 }