Ejemplo n.º 1
0
        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());
        }