public void SetUp() { _publishedCommands = new List <Tuple <string, object> >(); _writer = new FakeWriter(this); _sut = new ProjectionCoreResponseWriter(_writer); Given(); When(); }
public ProjectionWorkerNode( Guid workerId, TFChunkDb db, IQueuedHandler inputQueue, ITimeProvider timeProvider, ISingletonTimeoutScheduler timeoutScheduler, ProjectionType runProjections, bool faultOutOfOrderProjections) { _runProjections = runProjections; Ensure.NotNull(db, "db"); _coreOutput = new InMemoryBus("Core Output"); IPublisher publisher = CoreOutput; _subscriptionDispatcher = new ReaderSubscriptionDispatcher(publisher); _spoolProcessingResponseDispatcher = new SpooledStreamReadingDispatcher(publisher); _ioDispatcher = new IODispatcher(publisher, new PublishEnvelope(inputQueue)); _eventReaderCoreService = new EventReaderCoreService( publisher, _ioDispatcher, 10, db.Config.WriterCheckpoint, runHeadingReader: runProjections >= ProjectionType.System, faultOutOfOrderProjections: faultOutOfOrderProjections); _feedReaderService = new FeedReaderService(_subscriptionDispatcher, timeProvider); if (runProjections >= ProjectionType.System) { _projectionCoreServiceCommandReader = new ProjectionCoreServiceCommandReader( publisher, _ioDispatcher, workerId.ToString("N")); var multiStreamWriter = new MultiStreamMessageWriter(_ioDispatcher); _slaveProjectionResponseWriter = new SlaveProjectionResponseWriter(multiStreamWriter); _projectionCoreService = new ProjectionCoreService( workerId, inputQueue, publisher, _subscriptionDispatcher, timeProvider, _ioDispatcher, _spoolProcessingResponseDispatcher, timeoutScheduler); var responseWriter = new ResponseWriter(_ioDispatcher); _coreResponseWriter = new ProjectionCoreResponseWriter(responseWriter); } }
public ProjectionWorkerNode( Guid workerId, TFChunkDb db, QueuedHandler inputQueue, ITimeProvider timeProvider, ISingletonTimeoutScheduler timeoutScheduler, ProjectionType runProjections) { _runProjections = runProjections; Ensure.NotNull(db, "db"); _coreOutput = new InMemoryBus("Core Output"); IPublisher publisher = CoreOutput; _subscriptionDispatcher = new ReaderSubscriptionDispatcher(publisher); _spoolProcessingResponseDispatcher = new SpooledStreamReadingDispatcher(publisher); _ioDispatcher = new IODispatcher(publisher, new PublishEnvelope(inputQueue)); _eventReaderCoreService = new EventReaderCoreService( publisher, _ioDispatcher, 10, db.Config.WriterCheckpoint, runHeadingReader: runProjections >= ProjectionType.System); _feedReaderService = new FeedReaderService(_subscriptionDispatcher, timeProvider); if (runProjections >= ProjectionType.System) { _projectionCoreServiceCommandReader = new ProjectionCoreServiceCommandReader( publisher, _ioDispatcher, workerId.ToString("N")); var multiStreamWriter = new MultiStreamMessageWriter(_ioDispatcher); _slaveProjectionResponseWriter = new SlaveProjectionResponseWriter(multiStreamWriter); _projectionCoreService = new ProjectionCoreService( workerId, inputQueue, publisher, _subscriptionDispatcher, timeProvider, _ioDispatcher, _spoolProcessingResponseDispatcher, timeoutScheduler); var responseWriter = new ResponseWriter(_ioDispatcher); _coreResponseWriter = new ProjectionCoreResponseWriter(responseWriter); } }