Beispiel #1
0
 public ProcessorEventSubscriptionProvider(IEventStoreFacade eventStore,
                                           IEventConverter eventConverter, IServiceProvider serviceProvider)
 {
     _eventStore      = eventStore;
     _eventConverter  = eventConverter;
     _serviceProvider = serviceProvider;
 }
 public ProjectionEventStreamSubscriptionProvider(IEventStoreFacade eventStore,
                                                  IEventConverter eventConverter, IProjectionEventStreamRepository repo)
 {
     _eventStore     = eventStore;
     _eventConverter = eventConverter;
     _repo           = repo;
 }
Beispiel #3
0
        private static AggregateEventStream <HotelAggregate> GetStream(IEventStoreFacade connection,
                                                                       IAggregateSchema <HotelAggregate> schema)
        {
            AggregateEventStream <HotelAggregate> stream = new AggregateEventStream <HotelAggregate>(connection, new EventConverter(),
                                                                                                     new EventDataFactory(), new EventMetadataFactory <HotelAggregate>(), schema, Logger.None);

            return(stream);
        }
Beispiel #4
0
        public SubscriptionFactory(IEventStoreFacade connection, IServiceProvider serviceProvider)
        {
            _connection      = connection;
            _serviceProvider = serviceProvider;

            _onSpecMeth = this.GetType().GetMethod(nameof(OnSpecEventAppearead),
                                                   BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod);
        }
Beispiel #5
0
        public StreamJoinCoordinator(IEventStoreFacade connection,
                                     Serilog.ILogger logger, IServiceProvider serviceProvider)
        {
            this._connection = connection;

            _logger                    = logger;
            _serviceProvider           = serviceProvider;
            _readyPastCatchupReceivers = 0;
        }
 public EventStoreHubInitializer(IEventStoreFacade connection,
                                 IHubContext <EventStoreHub> hubConnection, ILogger logger,
                                 IEventConverter eventConveter,
                                 IProjectionSchemaRegister projectionSchema)
 {
     this._connection       = connection;
     this._hubConnection    = hubConnection;
     this._logger           = logger;
     this._eventConverter   = eventConveter;
     this._projectionSchema = projectionSchema;
 }
Beispiel #7
0
        public async Task Subscribe(IEventStoreFacade connection)
        {
            _connection     = connection;
            _lastCheckpoint = await _checkpointRepo.GetLastCheckpoint();

            this.Subscription = await _connection.SubscribeToStreamAsync(_streamName,
                                                                         new StreamRevision(_lastCheckpoint ?? 0L),
                                                                         OnEventAppeared,
                                                                         OnLiveProcessingStarted,
                                                                         true,
                                                                         OnSubscriptionDropped);
        }
 public ProjectionEventStream(IEventStoreFacade connection,
                              IEventConverter eventConveter,
                              IEventDataFactory eventDataFactory,
                              IProjectionSchema <TProjection> projectionSchema)
 {
     _connection           = connection;
     _eventConveter        = eventConveter;
     _eventDataFactory     = eventDataFactory;
     _projectionSchema     = projectionSchema;
     _projectionStreamName =
         $"{ServiceConventions.GetCategoryFromNamespace(typeof(TProjection).Namespace)}Projection";
 }
Beispiel #9
0
            public async Task Configure(IEventStoreFacade connection, IEventHandlerDispatcher dispatcher, Serilog.ILogger logger)
            {
                _logger = logger;
                _logger.Information("Subscribed for {eventName} for local projections. (with EventDispatcher)", typeof(TEvent).Name);

                var stream = $"$et-{typeof(TEvent).Name}";

                this._dispatcher = dispatcher;

                // Should we wait for the subscription? - or should we re-subscribe
                await connection.SubscribeToStreamAsync(stream, OnReadEvent, true);
            }
 public ProjectionMultiEventStreamSubscriptionProvider(IEventStoreFacade eventStore,
                                                       IEventConverter eventConverter,
                                                       IProjectionEventStreamRepository repo,
                                                       IProjectionEventStream stream,
                                                       IProjectionSchema schema)
 {
     _eventStore     = eventStore;
     _eventConverter = eventConverter;
     _repo           = repo;
     _stream         = stream;
     _schema         = schema;
     _events         = new HashSet <Type>();
 }
 public AggregateEventStream(IEventStoreFacade connection,
                             IEventConverter eventConverter,
                             IEventDataFactory eventDataFactory,
                             IEventMetadataFactory <TAggregate> metadataFactory,
                             IAggregateSchema <TAggregate> aggregateSchema, Serilog.ILogger logger)
 {
     _connection       = connection;
     _eventConverter   = eventConverter;
     _eventDataFactory = eventDataFactory;
     _metadataFactory  = metadataFactory;
     _aggregateSchema  = aggregateSchema;
     _logger           = logger;
 }
Beispiel #12
0
            public async Task Configure(IEventStoreFacade connection,
                                        IEventConverter eventConverter,
                                        IHubContext <EventStoreHub> hubConnection, Serilog.ILogger logger)
            {
                Log        = logger;
                _converter = eventConverter;
                var stream = $"$et-{typeof(TEvent).Name}";

                this._connection = hubConnection;
                var t = await connection.SubscribeToStreamAsync(stream, StreamRevision.Start, OnReadEvent, null, true);

                Log.Information("Subscribed for {eventName} for pushing to signalR clients.", typeof(TEvent).Name);
            }
Beispiel #13
0
        public static async Task BindToSignalHub(this IEventStoreFacade connection,
                                                 IEventConverter eventConverter,
                                                 IProjectionSchemaRegister projectionSchema,
                                                 IHubContext <EventStoreHub> hubConnection, Serilog.ILogger logger)
        {
            foreach (var e in projectionSchema.Events)
            {
                var configuratorType = typeof(SignalRConfigurator <>).MakeGenericType(e);
                var configurator     = Ctor <ISignalRConfigurator> .Create(configuratorType);

                await configurator.Configure(connection, eventConverter, hubConnection, logger);
            }
        }
 public ProjectionEventSubscriptionProvider(IEventStoreFacade eventStore, IEventConverter eventConverter) : base(eventStore, eventConverter)
 {
 }
 protected SingleEventSubscriptionProvider(IEventStoreFacade eventStore, IEventConverter eventConverter)
 {
     _eventStore     = eventStore;
     _eventConverter = eventConverter;
 }
Beispiel #16
0
 public EventStoreSubscriber(IEventStoreFacade connection, IEventHandlerDispatcher dispatcher, ILogger logger)
 {
     this._connection = connection;
     this._dispatcher = dispatcher;
     this._logger     = logger;
 }