Questions tagged [event-handling]

44 questions
11
votes
4 answers

Is the C# EventHandler designed the wrong way?

State of the union: C# Events/Eventhandlers are: blocking throwing Exceptions sequential deterministic executed in order MulticastDelegates a handler is always dependent on the behavior of the handlers registered earlier Actually they are pretty…
juwens
  • 259
  • 2
  • 7
6
votes
2 answers

How to deal with file events with microservice that exposes a REST API

A bit of context. The company where I work is starting to transition to a modular architecture (something similar to microservices) for our main product, currently monolithic. The first step is to build a service that is currently not present in the…
5
votes
2 answers

Handle failures in Event Driven Architecture

Suppose you have a bounded context with ~30 business events and, for simplicity sake, the same number of commands like ChangeUserEmailCommand -> UserEmailChangedEvent initiated from a web UI. Processing a command may fail for the following main…
4
votes
2 answers

Passing data through events to adhere to the Tell-Don't-Ask principle?

In my little WinForm app, intended to practice as a hobbyist, I'm using this code to pass data from the View to its Presenter: public event Action? SearchInAlbums; private void Btn_SearchInAlbums_Click(object…
Valmont
  • 173
  • 6
4
votes
2 answers

How do event sourced systems make sure the read model is only updated once?

Currently looking into Event Sourcing in a Microservices architecture and I've found this article. It describes a possible implementation of CQRS and event sourcing. If the logic dealing with updating the read model and creating the events are both…
3
votes
2 answers

Does creating one thread per event subscriber scale well?

I'm working on an application implemented in different microservices, which uses a message broker (event bus) to consume events (simple pub/sub). As for now, in a given microservice, we are spawning 1 thread per event subscriber, which will be…
underthevoid
  • 500
  • 4
  • 10
3
votes
3 answers

DDD: How to properly process events without using Event Store or Event Sourcing

Does this make sense or what is wrong with this approach? So instead of using event store, we may use aggregate repository to update the aggregate based on values contained in published event.
Slimer
  • 217
  • 1
  • 9
2
votes
1 answer

In an event-driven system, what are the best practices around the number of events and size/atomicity?

If you can have one event with multiple "things to process" or one event per thing to process, what is considered the best practice? Bearing in mind, the former option may involve persisting the payload in a DB (because it's too big) whilst the…
2
votes
3 answers

Subscribe to topics or to messages on those topics?

I've encountered a couple of different techniques for dealing with service bus messaging (queues and topics) and I'm just looking for some input on best practices. I've encountered a couple of different techniques for consuming messages off of a…
Sinaesthetic
  • 302
  • 2
  • 12
2
votes
3 answers

How does "event triggers event" really work in Event Sourcing / CQRS?

After reading/watching a lot about Event Sourcing, there is one thing I don't fully understand: Events that lead to triggering of other events. Let's take StackExchange's "close question" feature as an example. The feature requires commands like…
2
votes
2 answers

Error handling in an event driven system

The context I have two components A & B, which communicate through events . Components B is responsible for long running background processes and it listens to the following event: startProcess(uniqueID) Component A is sending the startProcess…
2
votes
1 answer

Event Handling in Pygame

I am working on setting up a game in pygame and I've noticed that there isn't really a lot available for event handling. Basically, pygame has a queue of events that you can pull and iterate through every frame. It's easy enough to do, but I feel…
ryan28561
  • 123
  • 4
2
votes
3 answers

Serialization of messages on a servicebus and microservice architecture

In a microservice-based system, it exist some principles. Sam Newman often refers to them as these: You should always model your application around the domain A culture of automation. Automate whats possible to automate Hide your implementation…
2
votes
4 answers

Domain Events, CQRS, and dependency resolution in handlers

Currently: ASP.NET Core 2.2. I've been doing quite an extensive research in this topic (Domain Driven Design used together with Clean Architecture): DDD: Where to place domain event handlers? And I've seen a couple of DDD and Clean Architecture…
2
votes
3 answers

What should a method which creates conditionally self-unsubscribing event-handlers be named?

I develop/maintain an in-house library in a growing company with about 12 other developers that write code. This library is mostly used for scripting game behavior and we have many different projects that make use of it. This library implements…
1
2 3