public PersistentSubscriptionParams(bool resolveLinkTos, string subscriptionId, string eventStreamId, string groupName, 
                                    int startFrom, bool extraStatistics, TimeSpan messageTimeout, 
                                    int maxRetryCount, int liveBufferSize, int bufferSize, int readBatchSize,
                                    TimeSpan checkPointAfter, int minCheckPointCount,
                                    int maxCheckPointCount, int maxSubscriberCount, 
                                    IPersistentSubscriptionConsumerStrategy consumerStrategy,
                                    IPersistentSubscriptionStreamReader streamReader, 
                                    IPersistentSubscriptionCheckpointReader checkpointReader, 
                                    IPersistentSubscriptionCheckpointWriter checkpointWriter,
                                    IPersistentSubscriptionMessageParker messageParker)
 {
     _resolveLinkTos = resolveLinkTos;
     _subscriptionId = subscriptionId;
     _eventStreamId = eventStreamId;
     _groupName = groupName;
     _startFrom = startFrom;
     _extraStatistics = extraStatistics;
     _messageTimeout = messageTimeout;
     _maxRetryCount = maxRetryCount;
     _liveBufferSize = liveBufferSize;
     _bufferSize = bufferSize;
     _checkPointAfter = checkPointAfter;
     _minCheckPointCount = minCheckPointCount;
     _maxCheckPointCount = maxCheckPointCount;
     _maxSubscriberCount = maxSubscriberCount;
     _consumerStrategy = consumerStrategy;
     _readBatchSize = readBatchSize;
     _streamReader = streamReader;
     _checkpointReader = checkpointReader;
     _checkpointWriter = checkpointWriter;
     _messageParker = messageParker;
 }
 public PersistentSubscriptionParams(bool resolveLinkTos, string subscriptionId, string eventStreamId,
                                     string groupName,
                                     long startFrom, bool extraStatistics, TimeSpan messageTimeout,
                                     int maxRetryCount, int liveBufferSize, int bufferSize, int readBatchSize,
                                     TimeSpan checkPointAfter, int minCheckPointCount,
                                     int maxCheckPointCount, int maxSubscriberCount,
                                     IPersistentSubscriptionConsumerStrategy consumerStrategy,
                                     IPersistentSubscriptionStreamReader streamReader,
                                     IPersistentSubscriptionCheckpointReader checkpointReader,
                                     IPersistentSubscriptionCheckpointWriter checkpointWriter,
                                     IPersistentSubscriptionMessageParker messageParker)
 {
     _resolveLinkTos     = resolveLinkTos;
     _subscriptionId     = subscriptionId;
     _eventStreamId      = eventStreamId;
     _groupName          = groupName;
     _startFrom          = startFrom;
     _extraStatistics    = extraStatistics;
     _messageTimeout     = messageTimeout;
     _maxRetryCount      = maxRetryCount;
     _liveBufferSize     = liveBufferSize;
     _bufferSize         = bufferSize;
     _checkPointAfter    = checkPointAfter;
     _minCheckPointCount = minCheckPointCount;
     _maxCheckPointCount = maxCheckPointCount;
     _maxSubscriberCount = maxSubscriberCount;
     _consumerStrategy   = consumerStrategy;
     _readBatchSize      = readBatchSize;
     _streamReader       = streamReader;
     _checkpointReader   = checkpointReader;
     _checkpointWriter   = checkpointWriter;
     _messageParker      = messageParker;
 }
        internal PersistentSubscriptionService(IQueuedHandler queuedHandler, IReadIndex readIndex,
                                               IODispatcher ioDispatcher, IPublisher bus,
                                               PersistentSubscriptionConsumerStrategyRegistry consumerStrategyRegistry)
        {
            Ensure.NotNull(queuedHandler, "queuedHandler");
            Ensure.NotNull(readIndex, "readIndex");
            Ensure.NotNull(ioDispatcher, "ioDispatcher");

            _queuedHandler            = queuedHandler;
            _readIndex                = readIndex;
            _ioDispatcher             = ioDispatcher;
            _bus                      = bus;
            _consumerStrategyRegistry = consumerStrategyRegistry;
            _checkpointReader         = new PersistentSubscriptionCheckpointReader(_ioDispatcher);
            _streamReader             = new PersistentSubscriptionStreamReader(_ioDispatcher, 100);
            _timerTickCorrelationId   = Guid.NewGuid();
        }
        internal PersistentSubscriptionService(IQueuedHandler queuedHandler, IReadIndex readIndex, IODispatcher ioDispatcher, IPublisher bus, PersistentSubscriptionConsumerStrategyRegistry consumerStrategyRegistry)
        {
            Ensure.NotNull(queuedHandler, "queuedHandler");
            Ensure.NotNull(readIndex, "readIndex");
            Ensure.NotNull(ioDispatcher, "ioDispatcher");

            _queuedHandler            = queuedHandler;
            _readIndex                = readIndex;
            _ioDispatcher             = ioDispatcher;
            _bus                      = bus;
            _consumerStrategyRegistry = consumerStrategyRegistry;
            _checkpointReader         = new PersistentSubscriptionCheckpointReader(_ioDispatcher);
            _streamReader             = new PersistentSubscriptionStreamReader(_ioDispatcher, 100);
            //TODO CC configurable
            _tickRequestMessage = TimerMessage.Schedule.Create(TimeSpan.FromMilliseconds(1000),
                                                               new PublishEnvelope(_bus),
                                                               new SubscriptionMessage.PersistentSubscriptionTimerTick());
        }
Exemplo n.º 5
0
 /// <summary>
 /// Sets the event loader for the subscription
 /// </summary>
 /// <param name="loader"></param>
 /// <returns></returns>
 public PersistentSubscriptionParamsBuilder WithEventLoader(IPersistentSubscriptionStreamReader loader)
 {
     _streamReader = loader;
     return(this);
 }
 /// <summary>
 /// Sets the event loader for the subscription
 /// </summary>
 /// <param name="loader"></param>
 /// <returns></returns>
 public PersistentSubscriptionParamsBuilder WithEventLoader(IPersistentSubscriptionStreamReader loader)
 {
     _streamReader = loader;
     return this;
 }