Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
1answer
44 views

Aggregating events in event-driven system

Lets say there are two services. One generates event A and the other event B. We need to build a new service that implements the function C = func(A, B) , which produces the result C. But as A and B ...
0
votes
0answers
30 views

Using notifications when communicating between services in an event sourcing architecture?

In the context of web apps, I'm trying to get my head around how an event sourcing architecture communicates to services. First, I thought of services constantly polling the event store, but then, ...
2
votes
1answer
132 views

How can I optimize an alert system that processes 1000 requests / hour?

I am building a solution where IoT-devices send in measurement-data to an API that's hosted on AWS. For each measurement-type the user can set a threshold value; that when reached will trigger an ...
1
vote
1answer
79 views

What is a good technique to process an event stream to ensure sequential or transactional consistency

I am trying to improve an event-driven processing system, which is having a few problems because the events are not guaranteed to arrive in the correct chronological sequence. This is due to batching ...
4
votes
3answers
237 views

Dealing with data arriving at a different times

I have a load balanced service that needs two data inputs to correctly give a result. One of these inputs comes from a queue, the other comes from user input. Most of the time the data that comes ...
2
votes
0answers
26 views

Correct event managment architecture in web application

My team and I are working on a large web application, and I've noticed that we're working in a way which I believe is an incorrect usage of flux (probably from lack of understanding). We're using ...
1
vote
0answers
44 views

Event based architecture - multiple producers single consumer

I'm having a discussion at work that event-based architecture should not be used in a scenario that we have multiple producers and a single consumer. In our company, we have many external ...
-1
votes
1answer
72 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 ...
1
vote
1answer
244 views

What is the relationship between event driven design and state machines/charts?

I'm trying to understand event driven design better and have not picked up a book on it yet. But just from others explaining it to me it seems to be really similar to state machines/charts. What are ...
0
votes
1answer
135 views

What is the correct granularity for events in the context of designing a rule-based decision system?

Introduction We need to design a system that, given a set of events that are happening in the source application, reacts to them and if some conditions have been met, actions can be triggered. Users ...
1
vote
1answer
288 views

Event Driven Microservice Architecture & Dealing with synchronous external neighboring systems

Let’s say I have an event driven microservice system - a microservice cluster - that takes orders and works with them. Orders are placed by an external neighbor system that is working synchronously ...
-1
votes
1answer
58 views

How to mimic an event system with a boolean system

In a boolean system, say you have a while loop going on. Then you might have this: if (just_did_x) { do_something() } To prevent it calling do_something() more than once, you might do: if (...
0
votes
2answers
575 views

Designing events in an event-driven (event sourced) architecture and managing duplication

I have been creating a POC for a part of our system but I'm finding some trouble communicating some of the ideas behind it. This takes ideas from Event Sourcing and Event Driven Architecture but ...
1
vote
1answer
241 views

How to sync data between two detached systems using rest API?

I own system A, and other entity owns system B. I need to sync system B, based on changes that took place in system A. Data being synced would be spitted into different sets, so I dont have to sync ...
2
votes
3answers
434 views

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 ...
3
votes
2answers
280 views

Can an aggregate only ever consume commands and produce events?

In domain driven design based on domain events, I have the impression that several sources pronounce the rule that aggregates consume commands and produce events process managers consume events and ...
0
votes
0answers
97 views

How do I not lose the “reactive” nature of my services, simply because one of the services isn't reactive?

I've lately been very interested in reactive microservice design with streaming and event-driven architectures. When one writes (i.e., manages) services, this paradigm works extremely well by simply ...
3
votes
2answers
85 views

Guaranteeing transactions with multiple Listeners

Recently my team has inherited a code-base with an interesting problem. The system keeps historical records by having multiple listeners on the same event. These listeners execute serially, so if we ...
6
votes
2answers
483 views

Designing event-driven architecture for multiple services

I've created about a dozen services for a intranet. Now I've gotten to the point that these services are more coupled to each other than I'm comfortable with, and I've been having problems where once ...
1
vote
1answer
82 views

What kind of granularity is recommended in reactive programming when publishing state change events?

I'm currently developing an application using reactive programming. Every entity creation or modification in the system publishes an event and no two entities can be created/modified within the same ...
1
vote
2answers
578 views

Does an event-driven architecture require that each actor owns his data?

We had a discussion over this topic at the work not long ago. We have the following situation: A legacy database which is currently the base for the main operational application in our company. A ...
4
votes
2answers
337 views

What is constraining cross-platform asynchronous file I/O?

Looking at a range of cross-platform languages, libraries and GUI toolkits, I often notice a conspicuous absence of support for asynchronous file I/O. This seems like too much of a common factor to be ...
0
votes
2answers
128 views

Trigger no more than M events per second, simulate N increments per second

What algorithm should I use, to simulate a continual stream of N increments each second — not writing a loop, but instead by timed-interval events, no more than M events per second? I am implementing ...
124
votes
11answers
19k 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 ...
7
votes
2answers
179 views

Information sharing in event-based systems

I'm developing a software system, which provides HTTP REST API, and I want to achieve a very modular and flexible design. So, there is a core functionality and feature modules, which handle only the ...
2
votes
1answer
800 views

Event-driven architecture and synchronization with a “First-timer microservice”

I'm working on a distributed application and getting deeper into Event-Driven architectures with Microservices. Let's say I have been running two Microservices, CustomerService and AccountService. ...
4
votes
1answer
593 views

What is so different about RTOS compared to normal programming?

Classical programs run a loop with prioritized ISRs. How do RTOS do this differently of better?
0
votes
1answer
838 views

WCF: Send events between services

I recently worked in a larger project where I touched the topic of distributed systems in the c# world the first time. I found that wcf is fantastic for remote procedure calls, but how do you add ...
8
votes
2answers
2k views

How do I deal with side effects in Event Sourcing?

Let's assume that we want to implement a small security subsystem for a financial application that warns the users via email if a strange pattern is detected. For this example, the pattern will ...
4
votes
3answers
220 views

Is an event based approach the right way to think about this problem?

I've got one requirement that is: When one employee starts working on a project and when he finishes working on it he must inform the system so that it can generate a report afterwards of how much ...
1
vote
2answers
137 views

Processing multiple type of messages in multiple ways

In a chat application there may be multiple types of incoming messages to be handled. For example, I have messages of these types: text, link, image, and video. Text and link are handled the same way, ...
13
votes
1answer
6k views

Why Protobuf 3 made all fields on the messages optional?

The syntax 3 of protobuf made all the fields optional dropping the keywords required and optional from previous proto2 syntax. Reading some comments from developers it seems that it was done for ...
0
votes
1answer
97 views

Achieve atomicity between two separate systems

I have a lot of cases where I need to persist some information into a database and complete a secondary action using third party system. For example I have a trivial case, to save user information ...
4
votes
2answers
207 views

Where should event debouncing be done, in the emitter or consumer?

Where does it make the most sense to debounce events? Consider the resize event of an internet browser. The browser can fire a myriad of resize events as a user clicks and drags to resize a browser ...
1
vote
2answers
92 views

In a web application, are Hooks and Event Subscriptions the same thing?

When I look at at some PHP applications, they typically have hooks. Drupal and Wordpress are examples. When I look at an application from the .NET world like Orchard or Umbraco, one subscribes to ...
3
votes
2answers
1k views

Child object calling a parent's function through a global variable

I have a Session object, of which a single global instance session holds the current session, which can persist itself to the server, handle undos redos etc. The session holds an instance of Objects ...
3
votes
2answers
148 views

Handling events based on their property

I'm working with an external system which sends event-like data to us. An existing SDK from the third-party guys parses the JSON so in the end we get something like the following class: public class ...
0
votes
0answers
114 views

Is the HTML / JavaScript event handling exactly the Chain of Responsibility design pattern?

Just except that Chain of Responsibility might go one straight line, but in the HTML event handling, it is first the "capture phase" (capturing), then the "at phase", and then the "bubble phase" (...
0
votes
2answers
393 views

Events fired when widgets are updated programmatically

In the GUI application I'm working on I have a number of custom (composite) widgets that I've created, with each widget having an update_gui function where I access my SQLite database so I can fill in ...
-6
votes
2answers
1k views

Why are event driven languages unsuitable for embedded systems, and what makes a language good for embedded systems? [closed]

I'm doing an essay on this for college and I can't really find sources. So far I've found these: https://www.quora.com/Which-is-the-best-programming-language-for-embedded-system http://www.eetimes....
1
vote
0answers
74 views

Capturing keyboard events for a limited time

I'm trying to code a kind of simple video game where there are two kind of players: Human Players: They enter an keyboard input CPU Players: A random input is calculated For Human Players there is a ...
0
votes
1answer
49 views

How to handle events in extended classes?

When one extends a class, how is the proper way of setting code to be executed upon some event of the base class? Should one handle the base class event this way: Public Class Class2 Inherits ...
5
votes
1answer
507 views

Parallelism when using Azure Functions to update a DocumentDB document

I'm writing a web app which allows users to upload real-estate listings. Part of what this does is allow them to upload photos of the property they're listing. I'm using a micro-service type approach ...
6
votes
4answers
1k views

How to ensure a method handling each event in an event system?

I have several types of events, for example: abstract class Event { static class KeyPress extends Event { ... } static class KeyRelease extends Event { ... } static class KeyHold extends ...
0
votes
1answer
525 views

CQRS - Passing aggregate root as argument

So, I have following code: public class CQRSQuestion { public static void main(String[] args) { //received command for algorithm run AlgorithmAR algorithmAR = new AlgorithmAR(...
3
votes
1answer
113 views

Is it better to dispatch one event or multiple events for remote calls?

In ActionScript the URLLoader class that has seven separate events than can occur after you call the load() method. In the HTTPServive classes there are two events, fault and result. In one of the ...
11
votes
2answers
3k views

How to create new aggregate root in CQRS?

How should we create new aggregate roots in cqrs architecture? In this example I want to create new aggregate root AR2 that holds reference to first one AR1. I'm creating AR2 using AR1 method as ...
6
votes
2answers
320 views

Best event based architecture for Linux to GUI

I've looked around a bit and probably haven't found the right medium for this question so let me know if there's a different forum I should bother. First, there is an application managed by another ...
5
votes
2answers
218 views

Update model chain on event driven pattern

What is the formal name for this specific problem scenario in an event-driven architecture, and what are the common approaches to handle it?: After an action or event is dispatched, several ...
4
votes
2answers
194 views

How can I avoid both objects A and B using class C (or is it unavoidable)?

I have the following setup: An object A running as a separate service with its own address (implemented via Pyro package in Python). An object B running as a separate service with its own address. ...