Stack Exchange Network

Stack Exchange network consists of 174 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
votes
1answer
35 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
50 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
78 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 ...
0
votes
0answers
53 views

Java RPC - Notify client without client-side method call

The current project is a basic java web application written with the RPC pattern and java ObjectStream... Here a some base classes used by my basic framework: public abstract class AbstractServer ...
1
vote
1answer
127 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
393 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
122 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
277 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
184 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
89 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 ...
0
votes
0answers
16 views

How should Selection selectfinish/selectend event be implemented?

I'm looking to do something whenever a user finishes making a selection —essentially, on the first mouseup event after every selectstart event, I think— on the page. I want to take that selection and ...
3
votes
2answers
81 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 ...
5
votes
2answers
395 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
75 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
485 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
298 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
124 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 ...
123
votes
11answers
17k 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 ...
6
votes
2answers
158 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
678 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
517 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
726 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 ...
7
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
214 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
124 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, ...
6
votes
1answer
4k 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
90 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
189 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
89 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 ...
0
votes
0answers
113 views

“Canonical” set of operator overloads for a wrapper class

I'm working with a straight-C graphics API (Allegro 5) that defines a union type to hold data generated by various system events, call it "ALLEGRO_EVENT". The C API passes unions of this type to ...
3
votes
2answers
141 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
112 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
302 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 ...
-5
votes
2answers
993 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
71 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
47 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
500 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
482 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
104 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
2k 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
311 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
190 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. ...
6
votes
1answer
1k 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 ...
2
votes
1answer
922 views

Is it a bad practice to subscribe to an event with an Action

I use a third party library for speech recognition. This library give me access to some classes ( SpeechRecognitionEngine, SpeechRecognitionConfiguration etc) which give me access to some events (...
5
votes
2answers
312 views

Is a promise-aware eventing system desirable?

I'm fully aware that Promises and eventing are both ways to do asynchronous programming, and you can choose either one for a given project. However, in practice, the code base I'm working with is ...
6
votes
1answer
180 views

How to trigger other events in MVC, once the desired event completes?

What is a technique in MVC that can be used to trigger updates? Namely, When user clicks a button save a product I have this: function saveProduct($product) { $this->repository->...