コード例 #1
0
        protected virtual IReaderStrategy CreateCheckpointStrategy()
        {
            var readerBuilder = new SourceDefinitionBuilder();

            if (_source != null)
            {
                _source(readerBuilder);
            }
            else
            {
                readerBuilder.FromAll();
                readerBuilder.AllEvents();
            }

            var           config         = ProjectionConfig.GetTest();
            IQuerySources sources        = readerBuilder.Build();
            var           readerStrategy = Core.Services.Processing.ReaderStrategy.Create(
                "test",
                0,
                sources,
                _timeProvider,
                stopOnEof: false,
                runAs: config.RunAs);

            return(readerStrategy);
        }
コード例 #2
0
 public void it_can_be_created()
 {
     CheckpointStrategy.Create(
         new QuerySourcesDefinition {
         AllStreams = true, AllEvents = true
     }, ProjectionConfig.GetTest(),
         new RealTimeProvider());
 }
コード例 #3
0
 public override void Setup()
 {
     base.Setup();
     _bus.Subscribe <CoreProjectionStatusMessage.Suspended>(_service);
     _service.Handle(new CoreProjectionManagementMessage.CreateAndPrepare(
                         _projectionId, _workerId, "test-projection",
                         new ProjectionVersion(), ProjectionConfig.GetTest(),
                         "JS", "fromStream('$user-admin').outputState()"));
     _service.Handle(new ProjectionCoreServiceMessage.StopCore(_stopCorrelationId));
 }
コード例 #4
0
        protected virtual CheckpointStrategy CreateCheckpointStrategy()
        {
            var result        = new CheckpointStrategy.Builder();
            var readerBuilder = new ReaderStrategy.Builder();

            if (_source != null)
            {
                _source(readerBuilder);
                _source(result);
            }
            else
            {
                readerBuilder.FromAll();
                readerBuilder.AllEvents();
                result.FromAll();
                result.AllEvents();
            }
            var config = ProjectionConfig.GetTest();

            return(result.Build(config, null, readerBuilder.Build(new RealTimeProvider(), runAs: null)));
        }