public ImmediateConventionDenormalizerPipeline(DenormalizerConfiguration config,
                                                DenormalizerDiContext diContext,
                                                ILogger <ConventionEventHandler> logger, IBackgroundEventQueue queue = null)
 {
     conventionHandler = new ConventionEventHandler(diContext, logger, queue,
                                                    config.DenormalizerAssemblies);
 }
        public static EventDenormalizer AttachDenormalizer(this IEventStoreConnection connection,
                                                           IStreamPositionGateway gtw, UserCredentials creds, string streamName, Func <Type, object> normalizerFactory,
                                                           params Assembly[] normalizerAssemblies)
        {
            var subscriber = new EventSubscriber(connection, creds, streamName,
                                                 new EventTransformator(new JsonEventSerializer(new EventTypeResolver())));
            var eventHandler = new ConventionEventHandler(normalizerFactory, normalizerAssemblies);
            var result       = new EventDenormalizer(subscriber, eventHandler, gtw);

            return(result);
        }
Esempio n. 3
0
        private static void StartDenormalizer(IMongoDatabase db, params Assembly[] normalizerASsemblies)
        {
            var subs = new MongoEventSubscriber(db);
            var pos  = new MongoStreamPositionGateway(db, null);
            var normalizerFactory = new Func <Type, object>(Activator.CreateInstance);

            var eventHandler = new ConventionEventHandler(normalizerFactory, normalizerASsemblies);
            var result       = new EventDenormalizer(subs, eventHandler, pos);

            result.StartAsync(TimeSpan.FromSeconds(1)).Wait();
        }
Esempio n. 4
0
 public WhenEventIsRaised()
 {
     sut = new ConventionEventHandler(Activator.CreateInstance,
                                      typeof(SampleDenormalizer).GetTypeInfo().Assembly);
 }
Esempio n. 5
0
        public void ItGetsCreatedIfAssemblyIsPresent()
        {
            ConventionEventHandler sut = GetSut(GetType().GetTypeInfo().Assembly);

            Assert.NotNull(sut);
        }
 public WhenLocatingDenormalizers()
 {
     sut = GetSut(typeof(SampleDenormalizer).GetTypeInfo().Assembly);
 }