Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public MyEventConsumerActor(
     EventDataFormatter formatter,
     IEventStore eventStore,
     IEventConsumerInfoRepository eventConsumerInfoRepository,
     ISemanticLog log)
     : base(formatter, eventStore, eventConsumerInfoRepository, log)
 {
 }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }
Exemplo n.º 9
0
        public HandleEvents()
        {
            serializerSettings.Converters.Add(new PropertiesBagConverter());

            formatter = new EventDataFormatter(typeNameRegistry, serializerSettings);
        }
Exemplo n.º 10
0
 public MyEventConsumerGrain(EventDataFormatter formatter, IEventStore eventStore, ISemanticLog log)
     : base(formatter, eventStore, log)
 {
 }