Questions tagged [event-handling]
49 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
- 258
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
3 answers
How to handle events representing cross-domain knowledge
I've been looking at DDD lately as part of playing with Spring Modulith, and I'm getting hung up a bit on how to approach events which cross between contexts.
To provide a concrete example based on a (currently monolithic) domain I work with day to…
Simon Geard
- 389
5
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
Valmont
- 193
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…
UserControl
- 159
- 5
4
votes
1 answer
Event bus vs PubSub
I have been using queues and PubSub patterns for years but never really came across the terminology "event bus". After some googling I didn't really find a clear distinction between "event bus" and "PubSub". Are they the same, just semantic…
Frankster
- 189
4
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
- 510
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…
Torsten N.
- 151
3
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…
bluenote10
- 153
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
2
votes
2 answers
Handling parents events from child component, in a props down events up approach
This question is language/framework agnostic. EDIT: The comments and answers have highlighted how different languages approach events differently, which made me realize this question isn't really neutral across languages or frameworks. To clarify,…
Michael Haddad
- 2,727
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
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…
Cap Barracudas
- 1,159
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…
severestrength
- 123