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
0answers
102 views
What is the difference between Reactive programming and functional programming with async IO?
I'm confused as to why reactive programming such a hot new technology/model. As far as I can tell it's functional, evented, async IO. But that's been a thing with things like libevent, libev, libuv ...
3
votes
0answers
129 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 ...
4
votes
1answer
48 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
167 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.
...
5
votes
1answer
73 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
151 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
186 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 ...
2
votes
0answers
62 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->...
6
votes
6answers
272 views
How to create a timed-event architecture using a SQL database
The title of my question is general because I feel like this problem is of a general nature, but to set the stage I'm going to provide a specific example.
We use a homegrown workflow engine that is ...
1
vote
2answers
44 views
Proper event driven design when a consumer subscribes to many producers
I have a large number of instances of a class. Those instances can fire an event. The only important thing for that event is which instance fired it.
I have another instance of a class (and maybe in ...
0
votes
0answers
43 views
Sending events down a tunnel, and bubbling them back up
I am working on developing an HTML canvas application, where I need to be able to do my own UI event processing. That's where the stem of this question comes from, but I'd really like to understand ...
0
votes
1answer
64 views
How would you structure a flowchart/data flow diagram for an application that runs on a game engine?
I understand how you create flowcharts or data flow diagrams for simple linear based programming. But how do you design a flowchart for event based programming, like a game that runs on Unity3D? How ...
3
votes
1answer
77 views
Should I use a command or an event?
The difference between a command and an event in bus communication seems a little vague to me. I know that commands should be executed once only, while an event can be handled multiple times, but ...
5
votes
1answer
109 views
Can event emitters be functional?
For instance, array.map accepts a callback that returns a value.
const newArray = oldArray.map(item => doSomethingTo(item));
Promises also accept callbacks that return a value.
const ...
2
votes
0answers
33 views
Pattern matching events with arbitrary structure
My team implemented an alert broker system. The way it works is this:
Event sources generate events, with mostly arbitrary structure, and the broker listens to them.
Users go to the broker and use an ...
2
votes
1answer
71 views
What pattern should I set for handling event as working item?
I have this business event : "CustomerUpdated" published by my system.
I have many application listening to these events, and they do all king of action : sending email, updating the database, ...
0
votes
0answers
29 views
How to setup dependency injection framework in JavaScript
I'm creating a web page and would like to keep the UI and the JavaScript separate.
To accomplish that I'd like to add event listeners after the UI elements have been created. I don't know if this is ...
2
votes
1answer
53 views
ADO.NET - Is it better to handle a combo box or label event, and where should the data be sourced from?
Context
I recently wrote a final exam that required using a BindingSource object with ADO.NET to populate a number of combo box and label controls from which the user could perform basic business ...
53
votes
8answers
8k views
Are events only used for GUI programming?
Are events only used for GUI programming?
How do you handle in normal backend programming when something happens to this other thing?
1
vote
1answer
61 views
“An event can be made of two parts, the event header and the event body.” Is this about event or event notification?
From: https://en.wikipedia.org/wiki/Event-driven_architecture
Considering:
Events do not travel, they just occur.
Are the following statements valid?
Event channels are conduits in which events ...
4
votes
1answer
53 views
How to prevent endles event recursion when using event driven data view?
Consider that you have some graphical interface that represents some data structure. For example a text field:
This field is connected to the data structure through events. I tried to make diagram of ...
1
vote
2answers
201 views
In an event driven microservice environment, are domain events equal to topics?
A lot of messaging frameworks have the term "topic". In a ddd microservice architecture, do these topics always reflect the domain events?
0
votes
4answers
182 views
Callbacks without concurrency? [closed]
To sync on the terms I will first give my perspective on what a callback function in the simplest possible terms:
A callback function is a function that is executed as a response to a certain ...
3
votes
0answers
213 views
Event driven programming in Haskell
I'm new to Haskell, so this is more a high-level conceptual question. I've read this: https://wiki.haskell.org/Real_World_Applications/Event_Driven_Applications and it has this:
run :: Domain -> [...
6
votes
2answers
191 views
Ensure that callbacks registration and triggering don't cause infinite recursion
I just spent a long, miserable week debugging a stack-overflow in a C++/Qt application. The fundamental problem was that I had a function that accepted a callback, and in certain cases the callback ...
0
votes
0answers
37 views
Event dispatcher and state
I'm using an event emitter similar to Node's, with the following pseudo code:
event.on('onFuncBegin',(e)=>);
event.on('onFuncEnd',(e)=>);
let myFunc=()=>{
event.emit('onFuncBegin',...
1
vote
3answers
246 views
Use case for async/await?
Background
Most of the applications that I write are hour long sequential tests for electronic equipment. The equipment under test has a specification that is a state-machine that looks like...
Get ...
0
votes
1answer
148 views
Eventing solutions for Java legacy applications too old for real JMS queue/topic eventing?
What are some architectural solutions that can mimic eventing for systems (Java) that are too old to implement eventing solutions, such as conventional Queue/Topic based JMS messaging?
I have a ...
0
votes
0answers
91 views
What to use in case of waiting for something that is complete: delegates, events and/or thread
I try to give a concrete example.
Create a semaphore for a crossroads.
I have two semaphores. I have possibility to set a duration of semaphore 2 minutes, 5 minutes, 10m inutes etc.
When one ...
17
votes
4answers
2k views
Event-driven programming: when is it worth it?
Ok, I know the title of this question is almost identical to When should I use event based programming? but the answers of said question have not helped me in deciding whether I should use events in ...
1
vote
1answer
156 views
For Web front end, if there are 20 JavaScript files loading, how to track down the mouseover handler?
For Web front end programming, since any JavaScript can set up an event listener for "mouseover" or "mouseenter" for an element, if we are to track down what is the code that is responsible for making ...
1
vote
0answers
113 views
Using events and event subscribers to create windows in a desktop application
I should probably open this by saying I do mostly Web applications at work, which obviously have some major differences from typical desktop stuff.
I had a small Windows Forms program I'd made for ...
1
vote
1answer
120 views
“Who” should handle side tasks for events?
I'm currently on the process of creating a website/webapp.
My application is based on Node JS with the express framework.
My core backend concept consists of
routers: handle http request. Like [...
2
votes
1answer
185 views
Why does Node not support several event loops in one Process?
As the title says, why does Node not support several event loops in one Process? The idea, is that node spawns a user decided number of threads, which each have an event loop. When a new callback is ...
0
votes
2answers
85 views
What is the name for user-defined methods / functions that get called implicitly? [closed]
I want to mark such methods in my application code with a comment that highlights that these methods are expected to get called by the framework / compiler the application is written for, even if the ...
6
votes
4answers
755 views
Why use plus equals += for event registration?
In C#, you register an event like:
window.onClick += myHandler;
But why use this instead of a "register" method that takes your handler and registers it. E.g.:
window.registerOnClick(myHandler);
...
3
votes
0answers
89 views
Sharing identical events, with differing scopes, between client and server libraries, in a micro-service architecture
I have a shared user repository (id, name, e-mail, password, etc.) exposed as a REST service - and multiple independent web-sites accessing this REST service (from the back-end) as a means of sharing ...
9
votes
1answer
330 views
Is event sourcing only for when writes are rare?
I'm reading up on event sourcing and can't stop asking myself if it only makes sense in exotic situations where writes are very rare or military-grade auditing is required.
A non-exceptional system ...
1
vote
2answers
316 views
Persistence models for Event Sourcing
I am intrigued by the Event Sourcing pattern but am struggling to design an event sourcing model and put it in concrete form.
First off, I want to make sure that I understand the main use cases of ...
1
vote
1answer
163 views
Object Communication Design
Multiple top-level systems that communicate with each other via messages(events/commands).
The Main class of the program wraps around all the systems and has a message dispacher component wich ...
2
votes
1answer
100 views
Identity propagation using Azure service bus
We currently have a platform with a SOA architecture in which the user's identity is propagated from the web application via middle tier services (REST and SOAP) until we actually query our data ...
3
votes
0answers
165 views
Web framework architecture with non-blocking I/O
There's been a lot of news in the enterprise world lately, specially in the web, and I've decided to build a small web framework on top of Netty to learn more about asynchronous programming and event-...
0
votes
2answers
583 views
What's the simplest way to deal with events in C in this situation?
I'm writing a text-based game, in C. I want the game to handle NPCs movement and actions in the background, while the user is making his moves. I'd also use time-based events to tell the user when ...
1
vote
3answers
220 views
When is a event listener invoked during program execution?
I am using the Obervable-Observer Pattern.
MyClass extends Observable{
invokeListeners(){
doSomething;
setChanged();
notifyListeners();//This invokes onUpdate() in "implements ...
2
votes
3answers
343 views
Are imperative events an anti-pattern?
Are events which are intended to tell listeners to carry out explicit actions an anti-pattern?
Imagine a worker service which raises the event WorkStarted at its beginning and the event WorkFinised ...
1
vote
1answer
3k views
Should I use: One event multiple subscribers or multiple events multiple subscribers
I am writing a data acquisition application. I wondering whether I should use one event multiple subscribers or multiple events multiple subscribers. I am worried about performance. Also could I ...
0
votes
2answers
120 views
Receive events in an event-loop, single-threaded
Let's say I have a program which consists of a main event loop. The event loop should check for tasks and if one exists, it is to be processed. The user interface consists of a GUI with buttons, for ...
3
votes
1answer
170 views
Structure project based on platform or design?
I have a medium sized project (~10,000 lines) that runs on Windows and Linux. However it is only specific components of the program that are platform dependent and are located in a folder called ...
1
vote
2answers
392 views
Observer pattern without state change?
My question is whether there is a similar pattern to Observer that does not imply a state change in the observed object. The following is a concrete example:
I have a ConnectionFactory class which is ...
2
votes
1answer
104 views
What are the underlying patterns in systems allowing asynchronous operations?
Say I'm working with a system that allows async, nonblocking operations. If I queue up a set of those operations and specify their result buffer references:
nonblocking_write( message, write_buffer )...