public CollectionService( IEventStore eventStore, IPublishEvents eventsPublisher) { this.eventStore = eventStore; this.eventsPublisher = eventsPublisher; }
public UserStoryService( IEventStore eventStore, IPublishEvents eventsPublisher) { this.eventsPublisher = eventsPublisher; this.eventStore = eventStore; }
internal static async Task <PaymentCQRS> Build(BankPaymentStatus paymentStatus, IGenerateBankPaymentId bankPaymentIdGenerator, IConnectToAcquiringBanks bankConnectionBehavior, IProvideBankResponseTime delayProvider, IProvideTimeout providerForBankResponseWaiting, IKnowBufferAndReprocessPaymentRequest knowBufferAndReprocessPaymentRequest, IAmCircuitBreakers circuitBreakers, IThrowsException gatewayExceptionSimulator = null, IPublishEvents eventsPublisher = null) { var bus = eventsPublisher ?? new InMemoryBus(); var eventSourcedRepository = new EventSourcedRepository <Payment>(new InMemoryEventStore(bus)); var appSettingsAccessor = Substitute.For <IOptionsMonitor <AppSettings> >(); appSettingsAccessor.CurrentValue.Returns(new AppSettings { Executor = ExecutorType.Tests }); var random = Substitute.For <IGenerateAcquiringBankPaymentStatus>(); random.GeneratePaymentStatus().Returns(paymentStatus); var paymentsIdsMemory = new PaymentIdsMemory(); var bankAdapterSelector = new BankAdapterSelector(random, bankPaymentIdGenerator, delayProvider, bankConnectionBehavior, paymentsIdsMemory, NullLogger <BankAdapterSelector> .Instance); var merchantToBankAdapterMapper = new MerchantToBankAdapterMapper(bankAdapterSelector); var paymentRequestsMemory = new PaymentRequestsMemory(); var paymentProcessor = new PaymentProcessor(eventSourcedRepository, NullLogger <PaymentProcessor> .Instance, providerForBankResponseWaiting, knowBufferAndReprocessPaymentRequest, circuitBreakers, gatewayExceptionSimulator); var optionMonitor = Substitute.For <IOptionsMonitor <AppSettings> >(); optionMonitor.CurrentValue.Returns(new AppSettings { Executor = ExecutorType.Tests }); var paymentRequestCommandHandler = new PaymentRequestCommandHandler(eventSourcedRepository, paymentRequestsMemory, paymentProcessor, merchantToBankAdapterMapper, new RequestBankSynchronyMaster(optionMonitor), NullLogger <PaymentRequestCommandHandler> .Instance); var requestController = new PaymentRequestsController(paymentRequestCommandHandler, NullLogger <PaymentRequestsController> .Instance); var readController = new PaymentReadController(eventSourcedRepository); var paymentDetailsRepository = new PaymentDetailsRepository(NullLogger <PaymentDetailsRepository> .Instance); var paymentDetailsReadController = new PaymentsDetailsController(paymentsIdsMemory, paymentDetailsRepository); var readProjections = new ReadProjections(bus, paymentDetailsRepository); await readProjections.StartAsync(new CancellationToken(false)); var gatewayPaymentsIdsController = new GatewayPaymentsIdsController(paymentsIdsMemory); var acquiringBankPaymentsIdsController = new AcquiringBankPaymentsIdsController(paymentsIdsMemory); return(new PaymentCQRS(requestController, readController, paymentDetailsReadController, paymentRequestsMemory, paymentProcessor, gatewayPaymentsIdsController, acquiringBankPaymentsIdsController, readProjections)); }
/// <summary> /// Initializes a new instance of <see cref="EventDispatcher"/>. /// </summary> /// <param name="eventStore">The event store.</param> /// <param name="eventPublisher">The event publisher.</param> /// <param name="settings">The current event store settings.</param> internal EventDispatcher(IStoreEvents eventStore, IPublishEvents eventPublisher, IStoreEventSettings settings) { Verify.NotNull(eventStore, nameof(eventStore)); Verify.NotNull(eventPublisher, nameof(eventPublisher)); this.eventStore = eventStore; this.eventPublisher = eventPublisher; this.markDispatched = settings.MarkDispatched; }
public SellTicketsService( IConcertRepository concertRepository, IBuyerRepository buyerRepository, ITicketsService ticketsService, IPublishEvents eventPublisher) { _concertRepository = concertRepository; _buyerRepository = buyerRepository; _ticketsService = ticketsService; _eventPublisher = eventPublisher; }
protected BaseRepoSession(IHoldAllConfiguration configuration, IDisposable disposableHandle) { this.configuration = configuration ?? throw new ArgumentNullException(nameof(configuration)); this.disposableHandle = disposableHandle; NewEventsCollection = configuration.CollectionTypeSelector(stateType)(); currentState = default(TState); this.eventPublisher = configuration.EventPublisher; EventApplier = this.configuration.EventApplier; }
public AlarmClock(IPublishEvents bus) { workerThread = new Thread( _ => { while (!stopped) { lock (alarmLock) { var now = DateTime.UtcNow; var shouldSend = alarms.Where(x => x.AlarmTime > now).ToList(); foreach (var alarm in shouldSend) { bus.Publish(alarm.Message); alarms.Remove(alarm); } } Thread.Sleep(1); } }); }
public PublishingPipelet(IPublishEvents publisher) { this.publisher = publisher; }
public Waiter(string name, IPublishEvents next) { this.name = name; this.next = next; }
public AssistantManager(IPublishEvents next) { this.next = next; }
public Cashier(IPublishEvents next) { this.next = next; }
public EventsController(IPublishEvents publisher, IManageClaims claims) : base(claims) { _publisher = publisher; }
public TestPipelineAdapter(IPublishEvents publisher) { this.publisher = publisher; }
public Chef(IPublishEvents next, string name, double efficiency = 1) { this.next = next; this.efficiency = efficiency; this.name = name; }
public ChangeNameCommandHandler(IPublishEvents bus) { _bus = bus; }
/// <summary> /// Sets up telemetry to use topics to stream some <see cref="DomainEvent"/> types. /// </summary> /// <param name="bb">The <see cref="BigBrother"/> instance we are configuring.</param> /// <param name="publisher">The event publisher we are using to send events onto topics.</param> public static void PublishEventsToTopics(this IBigBrother bb, IPublishEvents publisher) { var bbImpl = bb as BigBrother ?? throw new InvalidOperationException($"Couldn't cast this instance of {nameof(IBigBrother)} to a concrete implementation of {nameof(BigBrother)}"); bbImpl.TopicPublisher = publisher; }
public EventStore(IPublishEvents serviceBus) { _serviceBus = serviceBus; }
public AddItemsToTheCart(IPublishEvents bus, ICreateBusinessEvents event_factory) { this.bus = bus; this.event_factory = event_factory; }
public EventStore(IPublishEvents eventPublisher) { _eventPublisher = eventPublisher; }
public PaymentReadProjector(IPublishEvents bus, IPaymentDetailsRepository paymentDetailsRepository) { _bus = bus; _paymentDetailsRepository = paymentDetailsRepository; }
public RoboMom(IPublishEvents publisher) { this.publisher = publisher; }
/// <summary> /// Initializes a new instance of <see cref="EventPublisherWrapper"/> /// </summary> /// <param name="bus">The event publisher to decorate.</param> /// <param name="statistics">The statistics class.</param> public EventPublisherWrapper(IPublishEvents bus, Statistics statistics) { this.statistics = statistics; this.bus = bus; }
public BookingStore(ISaveBooking saveBooking, IHandleClients handleClients, IPublishEvents publishEvents) { this.saveBooking = saveBooking; this.handleClients = handleClients; this.publishEvents = publishEvents; }
public ReadProjections(IPublishEvents bus, IPaymentDetailsRepository paymentDetailsRepository) { _paymentReadProjector = new PaymentReadProjector(bus, paymentDetailsRepository); }
public InMemoryEventStore(IPublishEvents publisher) { _publisher = publisher; }
public AccountRepository(IStoreEvents eventStore, IPublishEvents eventPublisher) { this.eventStore = eventStore; this.eventPublisher = eventPublisher; }
public PublishingPipelet(IPublishEvents publisher, IEventSpecification eventFilter) : base(eventFilter) { this.publisher = publisher; }
internal Bus(ISerializeMessages serializer, ISendMessages sender, IPublishEvents publisher) { this.serializer = serializer; this.sender = sender; this.publisher = publisher; }
/// <summary> /// Initializes a new instance of <see cref="EventDispatcher"/>. /// </summary> /// <param name="eventStore">The event store.</param> /// <param name="eventPublisher">The event publisher.</param> public EventDispatcher(IStoreEvents eventStore, IPublishEvents eventPublisher) : this(eventStore, eventPublisher, Settings.EventStore) { }
IManuallyConfigureEventAppliers IConfigureEventPublisher.WithEventPublisher(IPublishEvents publisher) { EventPublisher = publisher; return(new ApplierConfigurationBuilder(this)); }
public AlmacenarPedido(IPedidoRepository pedidoRepository, IClienteRepository clienteRepository, IPublishEvents publicarEventos) { this.pedidoRepository = pedidoRepository; this.clienteRepository = clienteRepository; this.publicarEventos = publicarEventos; }
public static WriteModelFacade BuildTheWriteModelHexagon(ISaveBooking saveBooking, IHandleClients handleClients, IPublishEvents eventPublisher, ISubscribeToEvents eventSubscriber) { var writeModelCommandHandler = new WriteModelFacade(new BookingStore(saveBooking, handleClients, eventPublisher)); CompositionRootHelper.SubscribeCommands(writeModelCommandHandler, eventSubscriber); return(writeModelCommandHandler); }
public static async Task PublishAsync <T>(T input, string topic, ISerializeMessages serializer = null, IPublishEvents publisher = null) where T : class { serializer = serializer ?? new JSONSerializer(); var newContext = new AFBusMessageContext { MessageID = Guid.NewGuid(), TransactionID = Guid.NewGuid(), BodyType = typeof(T).AssemblyQualifiedName }; publisher = publisher ?? new AzureEventHubPublishTransport(serializer); await publisher.PublishEventsAsync(input, topic, newContext).ConfigureAwait(false); }
public static WriteModelFacade BuildTheWriteModelHexagon(IPedidoRepository grabarPedido, IClienteRepository manejarClientes, IPublishEvents eventPublisher, ISubscribeToEvents eventSubscriber) { var writeModelCommandHandler = new WriteModelFacade(new AlmacenarPedido(grabarPedido, manejarClientes, eventPublisher)); CompositionRootHelper.SubscribeCommands(writeModelCommandHandler, eventSubscriber); return(writeModelCommandHandler); }
public CreateConcertService(IConcertRepository concertRepository, IPublishEvents eventPublisher) { _concertRepository = concertRepository; _eventPublisher = eventPublisher; }