Пример #1
0
 public ProjectionProcessor(
     IProjectionOptionsFactory optionsFactory,
     IProjectionFactory projectionFactory,
     IProjectionDiagnostics diagnostics)
 {
     this.projectionFactory = projectionFactory;
     this.diagnostics       = diagnostics;
     filters = optionsFactory
               .GetOptions <TProjection>()
               .Filters;
     projectionMetadata = projectionFactory
                          .GetProjectionMetadata <TProjection>();
     projectionName = typeof(TProjection).Name;
 }
Пример #2
0
        public ProjectionJob(
            IEventStoreClient client,
            IDependencyInitializer initializer,
            IProjectionOptionsFactory optionsFactory,
            IProjectionProcessor <TProjection> processor)
        {
            this.jobDependencies = initializer;
            this.processor       = processor;

            var options = optionsFactory.GetOptions <TProjection>();

            subscription = client.SubscribeToStreams(
                ConsumerGroup.GetAsAutoScalingInstance(options.Name),
                SubscriptionStartOptions.FromBegining,
                OnProcessEventsAsync);
        }