Questions tagged [event-programming]
Event-driven programming refers to the programming technique where the flow of the program is driven by recognition and handling of events such as mouse clicks, key presses, etc.
231
questions
2
votes
3
answers
130
views
Explicit business rules vs business rules through events?
I don't know how to look for this so I apologize if this is already answered.
I'm wondering how to decide what is best in terms of SRP and explicit business rules.
I feel that writing business logic ...
0
votes
1
answer
300
views
Capture a time-ordered sequence of item-level modifications via events when using Amazon Aurora
I'm designing a small platform based on a series of event-based micro-services. The persistence storage I'm targeting is (the managed) Amazon PostgreSQL (Amazon RDS for PostgreSQL) — although I can go ...
0
votes
1
answer
173
views
Azure Event Grid API layer beneath a HTTP API layer
I am part of a project/team that is building a new web app in Azure for the first time, having previously built and developed a traditional three tier ASP.NET web app over a number of years.
We have ...
0
votes
3
answers
207
views
Event-driven design with delayed consequences
EDIT: more direct situation
I need to design a program that will create particular objects and run computationally intensive procedures using its fields in order to update other fields. When a ...
0
votes
0
answers
100
views
Good reason not to do this: Pub/Sub with only 1 topic and publishers are also subscribers
Looking for a good reason to avoid this solution.
Problem
Multiple microservices/SAAS, each storing the same data that needs to be synced (example is customer contact details).
1st is an OAuth ...
1
vote
1
answer
615
views
How to handle aggregations of out-of-order events in an event stream?
I'm interested in integrating with an external system which uses webhooks to notify clients of events. The system is very similar to Stripe - the REST endpoints have rate limits to avoid undue polling ...
0
votes
0
answers
104
views
Kafka : Is sending some payload data (identifier) in headers considered a good practive?
I am wondering about some architectonical decisions in our system.
There are situations where we are sending import business events through kafka which should be performed in every case.
All the cases ...
2
votes
2
answers
701
views
A service having to have both an API and listen to events - Is this an anti-pattern for microservices?
I have a use case to create a service that consume messages from a message queue, process them, store them in the DB, and expose the processed results via an API. Therefore, the service I'm going to ...
0
votes
1
answer
92
views
Model events according to service internal domain model, or a shared model?
We have a system built on microservices with 50-100 different services. Previously most servcie-to-service communication was done with direct REST API calls, but we are shifting to a event based ...
0
votes
0
answers
275
views
Event Driven architecture - right way to build chain of events
Let's say we have a ecommerce platform.
When user create order - we should make several actions like
Send push to client
Send push to custome
Send emails
e.t.c
Generally I see two diffrent aproaches ...
2
votes
3
answers
2k
views
How can message queues improve scalability?
I have read in a DDD book that using message queues between communicating services can make the whole architecture more scalable, amazon's documentation mentions that queues provide granular ...
1
vote
1
answer
1k
views
Can Domain Services publish Domain Events on multi-aggregate operations?
I'm in a scenario where, when a certain command is applied on an aggregate, I have to
change the state of the aggregate itself
if ALL related aggregates are in the same state, then notify the world ...
10
votes
8
answers
3k
views
Why is there a shift towards asynchronous and event driven programming?
My question will be mostly about Linux and contemporary X86 hardware.
Clarifying the terms
async event based programming: spawning fixed amount of threads and using some user space scheduling ...
1
vote
0
answers
238
views
If you run a function in a different thread, but you wait for it to finish in your main thread, is that function asynchronous?
Backstory
Probably a stupid question, but I just have a sneaking suspicion that "asynchronous" is the wrong terminology to us for naming my template function here:
template <class T>
...
4
votes
1
answer
364
views
Pub-Sub pattern and instance replication
I am porting an event-driven architecture to a container environment (Docker) and I wonder how to take advantage of replication while using pub-sub: if I just increment replicas I end up with many ...
33
votes
7
answers
8k
views
Why do modern operating systems *ever* have perceptible input (keyboard/mouse) lag?
Sometimes computers stutter a bit when they're working hard, to the point where the mouse location freezes for a fraction of a second, or stutters intermittently for a few seconds. This sometimes ...
6
votes
2
answers
3k
views
Alternatives to outbox pattern, does outbox pattern break clean-architecture?
I've read and tried the Transactional Outbox pattern for communicating between services.
It is clear to me what are the benefits of this pattern, as it has two main parts:
By using a transaction, we ...
0
votes
1
answer
520
views
Clean code: Register listeners inside class handling events, or outside?
I'm writing a Java program with a custom event manager, which is of course the observer pattern. Should the calls to add event listeners/handlers be in the classes that listens/handles the events ...
-1
votes
2
answers
287
views
in an event driven architecture, should all stream consumers receive every message published to the stream?
I'm tinkering with the new streaming plugin provided with RabbitMQ, and researching how to implement event driven architectures in general.
I noticed in the default configuration (maybe I have it ...
0
votes
1
answer
336
views
Solving Event Dependence in Event Driven Systems
There are X Million Shipments per day. Each shipment has about 50 metrics to be calculated.
Each metric is calculated based on a type of the event(Let's say event_1 has the required information to ...
7
votes
3
answers
874
views
Event Driven Architecture - Best Practice
I am trying to understand the best practice around the event-driven architectures. say I have 2 services order service and inventory service. An user wants to order product and sends a request to ...
0
votes
1
answer
56
views
How to design an application for stalling file processing?
I have an application that is receiving a live stream of files, I am using active MQ for listening to the file arrival in s3. As soon as the file arrives in s3 my application downloads the file and ...
-1
votes
1
answer
375
views
Hardware test GUI with multiple event sources (4 serial ports and user interaction) - best architecture?
I have the following requirements:
Write a GUI app for automated testing of some custom PCB hardware.
The system must be usable for a technician with little to no advanced PC skills.
The test setup ...
0
votes
1
answer
461
views
Can I store a refresh token in a queue?
We have a standard microservices setup (Identity Server, API Gateway, services, etc).
Some of the services schedule events to be dispatched in the future (future = anything from mins to months ahead) -...
0
votes
2
answers
382
views
Events for entity state changes
When an entity is changed, I want to raise an event to notify potential consumers about the state changes. My question is, should I have
an xxxChanged event for each attribute, or
a single ...
-2
votes
1
answer
141
views
Event loop for console input
I have a server application that runs in an infinite loop, only reacting to SIGINT. It is put inside a screen process. If I have to make any changes (reload configuration, add new plugins, etc) I ...
0
votes
1
answer
87
views
What kind of bottlenecks are possible when implementing a distributed workflow using a central point of control?
I was going through https://docs.microsoft.com/en-us/azure/architecture/patterns/choreography, the document mentions in the drawbacks of having a central orchestrator that it can become a performance ...
139
votes
11
answers
38k
views
How does an event listener work?
During one of my lectures today about Unity, we discussed updating our player position by checking every frame if the user has a button pushed down. Someone said this was inefficient and we should use ...
0
votes
2
answers
102
views
Event Driver Microservice Can Storage Sent Message?
I have an event driven architecutre, with many microserver that publish a lot of message in my event bus.
In some case i can't track why some process is blocked, maybe because my Service-A haven't ...
1
vote
2
answers
1k
views
How would an event driven architecture deal with agregating events over a time period?
Say I have a service that is producing events of the format
type: SEND_MESSAGE,
to: '[email protected]',
And I have another service, that is saying, "for the next four hours, I want to consume all ...
2
votes
1
answer
308
views
Event Driven Architecture how should channels be used
I'm using event driven architecture, to perform realtime signal proccessing and to provide independent metrics.
I decided to use a redis cluster to act a cache and a message bus.
I'm a bit confused ...
0
votes
1
answer
957
views
Querying in event driven microservices
I am trying to get my head around "event driven" microservices. I understood, there are several techniques and patterns, like event notification, event sourcing, CQRS, etc that can help us to achive ...
2
votes
0
answers
43
views
Breadth first event synchronization based on a frequency or time series
I have an interesting and problem I'm facing. I'm trying to maintain a set of metrics independently based off of a time frequency.
Note: This is a simplification of the problem I've omitted pieces of ...
0
votes
1
answer
231
views
Designing Integration event application
We have a microservice that integrates with a third party system via REST API to handle appointment booking for our customer. It takes advantage of the event-driven model. Our microservice emits out ...
1
vote
2
answers
282
views
Locking (reserve) related Aggregate Roots
Problem
In my application a user can lock a set of related aggregate roots to work exclusively on them and to avoid the usage of an invalid set of objects later in the process (by other employees). ...
12
votes
3
answers
6k
views
What's the difference between reactive programming and event driven architecture?
What's the difference between reactive programming and event driven architecture?
Is reactive programming a way of implementing event driven programming?
0
votes
1
answer
633
views
Communicating state from the backend to the frontend while the user is logged in
Please note: although this question mentions Angular and Spring Boot (Java), and it would be great to get an answer from someone with experience in that stack, I think this is more of an architectural ...
3
votes
1
answer
136
views
When components of an event-driven program require specific responses to specific events, is event-driven still the correct approach?
I'm working on a multi-threaded program that interfaces with external USB/serial devices via user-space device drivers.
Early in the design stage, I made the decision to split the program into three ...
-1
votes
1
answer
204
views
How to record the sequence of events effectively when there is a logical flow runs over various event notifications?
Let me explain what I mean there is a logical flow runs over various event notifications based on our web app, which is event-driven and it is quite common in my opinion.
User clicks a button to ...
2
votes
1
answer
62
views
Need advice on approach for IOT project
I need some advice on an IOT project I am working on. Here are some details about what I am trying to do:
Use Case:
Periodically receive data from the 3rd party vendor API in real time and allow users ...
4
votes
1
answer
485
views
What is the right way of using event aggregator/message bus?
Recently I had a conversation with a colleague, who proposed that a whole app could rely on an event aggregator (or message bus).
I think this is a really good pattern if someone wants to decouple ...
0
votes
2
answers
73
views
Setting custom callbacks in a Javascript applet?
I'm designing a 3D visualisation applet in Javascript. When used, a Canvas will be created and placed inside an HTML element on a webpage, specified by the developer who is implementing the applet. ...
7
votes
1
answer
3k
views
Handling events and incoming Web API calls simultaneously
I'm working on a project where I got an architecture with multiple "Microservices" communicating with each other by using an event bus (RabbitMQ).
I got an Web API-project set up for each service so ...
8
votes
1
answer
622
views
Temporal logic as a programming language paradigm?
So I'm aware there's some degree of timing-based logic in existing programming languages, like threads and the sleep() function (and derivatives thereof), as well as events / delegates.
However, I was ...
1
vote
0
answers
381
views
RabbitMQ messages reliability for at-least-once delivery
I wanted to ask what are the possibilities of maintaining reliability when exchanging messages between microservices, when one of those message is rejected. As of today, we don't want to lose messages,...
2
votes
1
answer
2k
views
How to build a data pipeline through several microservices
We are building a microservice architecture.
We have one service which imports a set of data (usually, ca. 10MB). Another service should do some analysing and manipulation stuff on these data. A third ...
1
vote
3
answers
812
views
Event Carried State Transfer and initial state synchronization
I'm exploring Event Carried State Transfer patter, I understand how it works, but there is one problem I don't know how to solve.
So, in ECST, a service can listen to events and then build a private ...
0
votes
1
answer
433
views
Event sourcing: Update local data before posting an event?
We are introducing events to our system (I would hesitate to call it 'event sourcing', but we have started down this road). To do this we are still maintaining the same HTTP public 'CRUD' API's, but ...
1
vote
1
answer
321
views
What is the name of this kind of (intra-process, inter-thread, queue-based) event system?
Context
Espressif's embedded development libraries for the ESP32 microcontroller contain an event system based on FreeRTOS.
The event system handles connectivity, interrupts and other IO activity, but ...
1
vote
1
answer
245
views
Best approach to update the User Interface on consumed event(s)?
I am developing a microservice architecture where the API publishes a message through RabbitMQ. One or more consumers will read the message, preform its functions then if successful acknowledge the ...