Пример #1
0
        public EventConsumerActor(
            EventDataFormatter formatter,
            IEventStore eventStore,
            IEventConsumerInfoRepository eventConsumerInfoRepository,
            ISemanticLog log)
        {
            Guard.NotNull(log, nameof(log));
            Guard.NotNull(formatter, nameof(formatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventConsumerInfoRepository, nameof(eventConsumerInfoRepository));

            this.log = log;

            this.formatter  = formatter;
            this.eventStore = eventStore;
            this.eventConsumerInfoRepository = eventConsumerInfoRepository;

            var options = new ExecutionDataflowBlockOptions
            {
                MaxMessagesPerTask     = -1,
                MaxDegreeOfParallelism = 1,
                BoundedCapacity        = 10
            };

            dispatcher = new ActionBlock <object>(OnMessage, options);
        }
Пример #2
0
 public MyEventConsumerActor(
     EventDataFormatter formatter,
     IEventStore eventStore,
     IEventConsumerInfoRepository eventConsumerInfoRepository,
     ISemanticLog log)
     : base(formatter, eventStore, eventConsumerInfoRepository, log)
 {
 }
Пример #3
0
        public ContentVersionLoader(IEventStore eventStore, IStreamNameResolver nameResolver, EventDataFormatter formatter)
        {
            Guard.NotNull(formatter, nameof(formatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(nameResolver, nameof(nameResolver));

            this.formatter    = formatter;
            this.eventStore   = eventStore;
            this.nameResolver = nameResolver;
        }
        public DefaultDomainObjectRepository(IEventStore eventStore, IStreamNameResolver nameResolver, EventDataFormatter formatter)
        {
            Guard.NotNull(formatter, nameof(formatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(nameResolver, nameof(nameResolver));

            this.formatter    = formatter;
            this.eventStore   = eventStore;
            this.nameResolver = nameResolver;
        }
Пример #5
0
        public override void RunInitialize()
        {
            services = Services.Create();

            eventConsumer = new MyEventConsumer(NumEvents);

            eventStore = services.GetRequiredService <IEventStore>();

            eventDataFormatter = services.GetRequiredService <EventDataFormatter>();
            eventConsumerGrain = services.GetRequiredService <EventConsumerGrain>();

            eventConsumerGrain.ActivateAsync(services.GetRequiredService <StateHolder <EventConsumerState> >()).Wait();
            eventConsumerGrain.Activate(eventConsumer);
        }
Пример #6
0
        public EventConsumerGrain(
            EventDataFormatter formatter,
            IEventStore eventStore,
            ISemanticLog log)
        {
            Guard.NotNull(log, nameof(log));
            Guard.NotNull(formatter, nameof(formatter));
            Guard.NotNull(eventStore, nameof(eventStore));

            this.log = log;

            this.formatter  = formatter;
            this.eventStore = eventStore;
        }
Пример #7
0
        public ParseEventBlock(EventDataFormatter formatter, ISemanticLog log)
        {
            this.formatter = formatter;
            this.log       = log;

            var nullHandler = new ActionBlock <Envelope <IEvent> >(x => { });

            transformBlock =
                new TransformBlock <StoredEvent, Envelope <IEvent> >(x => HandleAsync(x),
                                                                     new ExecutionDataflowBlockOptions {
                BoundedCapacity = 1
            });
            transformBlock.LinkTo(nullHandler, x => x == null);
        }
Пример #8
0
        public EventConsumerActor(
            EventDataFormatter formatter,
            IEventStore eventStore,
            IEventConsumerInfoRepository eventConsumerInfoRepository,
            ISemanticLog log)
        {
            Guard.NotNull(log, nameof(log));
            Guard.NotNull(formatter, nameof(formatter));
            Guard.NotNull(eventStore, nameof(eventStore));
            Guard.NotNull(eventConsumerInfoRepository, nameof(eventConsumerInfoRepository));

            this.log = log;

            this.formatter  = formatter;
            this.eventStore = eventStore;
            this.eventConsumerInfoRepository = eventConsumerInfoRepository;
        }
Пример #9
0
        public HandleEvents()
        {
            serializerSettings.Converters.Add(new PropertiesBagConverter());

            formatter = new EventDataFormatter(typeNameRegistry, serializerSettings);
        }
Пример #10
0
 public MyEventConsumerGrain(EventDataFormatter formatter, IEventStore eventStore, ISemanticLog log)
     : base(formatter, eventStore, log)
 {
 }