public static void Run() { var eventTypeProvider = new DefaultEventTypeProvider <EventCountAggregate>(() => new[] { typeof(EventCountOne), typeof(EventCountTwo) });; var fileSystemSnapshotProvider = new FileSystemSnapshotProvider <EventCountAggregate>(); var defaultSnapshotStrategy = new DefaultSnapshotStrategy(5); var eventCountActorWithSnapshot = EventStoreStatefulActorBuilder <EventCountStatefulActor, EventCountAggregate, DemoSystemRegistry> .Create(StaticData.EventStoreUrl, Do.GetConnectionSettings(), ActorConfiguration.Default) .WithReadOneStreamFromStartCache(StaticData.EntityOne, eventTypeProvider: eventTypeProvider, getMultipleStreamsCatchupCacheConfiguration: builder => { builder.KeepAppliedEventsOnAggregate = true; }, snapshotStore: fileSystemSnapshotProvider, snapshotStrategy: defaultSnapshotStrategy) .Build(); var eventCountActor = EventStoreStatefulActorBuilder <EventCountStatefulActor, EventCountAggregate, DemoSystemRegistry> .Create(StaticData.EventStoreUrl, Do.GetConnectionSettings(), ActorConfiguration.Default) .WithReadOneStreamFromStartCache(StaticData.EntityOne, eventTypeProvider: eventTypeProvider, getMultipleStreamsCatchupCacheConfiguration: builder => { builder.KeepAppliedEventsOnAggregate = true; }) .Build(); Do.Run(eventCountActor, eventCountActorWithSnapshot); }
public static void Run() { var clusterVNode = EmbeddedVNodeBuilder .AsSingleNode() .RunInMemory() .WithWorkerThreads(1) .Build(); clusterVNode.StartAsync(true).Wait(); Log.Logger = new LoggerConfiguration() .MinimumLevel.Information() .MinimumLevel.Override("Microsoft", LogEventLevel.Debug) .WriteTo.Console() .CreateLogger(); var loggerFactory = new LoggerFactory().AddSerilog(Log.Logger); var eventTypeProvider = new DefaultEventTypeProvider <EventCountAggregate>(() => new[] { typeof(EventCountOne), typeof(EventCountTwo) });; var eventCountActor = EventStoreEmbeddedStatefulActorBuilder <EventCountStatefulActor, EventCountAggregate, DemoSystemRegistry> .Create(clusterVNode, Do.GetConnectionSettings(), ActorConfiguration.Default, loggerFactory) .WithReadAllFromStartCache( eventTypeProvider: eventTypeProvider, getCatchupEventStoreCacheConfigurationBuilder: builder => builder.KeepAppliedEventsOnAggregate = true) .Build(); Do.Run(eventCountActor); }
public static void Run() { var eventCountActor = EventStoreStatelessActorBuilder <EventCountStatelessActor, DemoSystemRegistry> .Create(StaticData.EventStoreUrl, Do.GetConnectionSettings(), ActorConfiguration.Default) .WithBus <IEventStoreBus>((actor, bus) => { actor.SubscribeFromEndToAllStreams(); }) .Build(); Do.Run(eventCountActor); }
public static void Run() { var eventTypeProvider = new DefaultEventTypeProvider <EventCountAggregate>(() => new[] { typeof(EventCountOne), typeof(EventCountTwo) });; var eventCountActor = EventStoreStatefulActorBuilder <EventCountStatefulActor, EventCountAggregate, DemoSystemRegistry> .Create(StaticData.EventStoreUrl, Do.GetConnectionSettings(), ActorConfiguration.Default) .WithReadManyStreamsFromStartCache( new[] { StaticData.EntityOne, StaticData.EntityTwo, StaticData.EntityThree }, eventTypeProvider: eventTypeProvider, getMultipleStreamsCatchupCacheConfiguration: builder => builder.KeepAppliedEventsOnAggregate = true) .Build(); Do.Run(eventCountActor); }
public static void Run() { var clusterVNode = EmbeddedVNodeBuilder .AsSingleNode() .RunInMemory() .WithWorkerThreads(1) .Build(); clusterVNode.StartAsync(true).Wait(); var eventTypeProvider = new DefaultEventTypeProvider <EventCountAggregate>(() => new[] { typeof(EventCountOne), typeof(EventCountTwo) });; var eventCountActor = EventStoreEmbeddedStatefulActorBuilder <EventCountStatefulActor, EventCountAggregate, DemoSystemRegistry> .Create(clusterVNode, Do.GetConnectionSettings(), ActorConfiguration.Default) .WithReadAllFromEndCache( eventTypeProvider: eventTypeProvider, getSubscribeFromEndCacheConfiguration: builder => builder.KeepAppliedEventsOnAggregate = true) .Build(); Do.Run(eventCountActor); }