Questions tagged [event-driven]

The event-driven paradigm of programming centralizes all waiting for events to one generalized loop that delivers (dispatches) events to registered listeners (event handlers).

The event-driven paradigm of programming centralizes all waiting for events to one generalized loop that delivers (dispatches) events to registered listeners (event handlers). When triggered, the event handlers change the state of the program, sometimes even by de-registering event handlers.

418 questions
11
votes
1 answer

jQuery custom events on non-DOM objects

I read some code recently that does something like this: bob = {'name': 'Bob Smith', 'rank': 7}; $(bob).bind("nameChanged", function () { /* ... */}); // ... $(bob).trigger("nameChanged"); This appears to work. But I can't find anything in the…
keturn
  • 4,780
  • 3
  • 29
  • 40
11
votes
2 answers

About the Mediator in Event-Driven Topology

I was reading this article called Variations in event-driven architecture in which they demonstrate both the mediator and broker topologies. According to the article the mediator topology looks somewhat like this: The event flow starts with the…
10
votes
5 answers

In Scala, how would I combine event driven programming with a functional approach?

To clarify what I mean by event driven I'm referring to a situation where I have def onTrade(...) Which is called every time a particular stock trades. Suppose I want to track the daily highest trade price. To me the obvious solution is: var…
deltanovember
  • 42,611
  • 64
  • 162
  • 244
10
votes
2 answers

Event driven microservices with message brokers (e.g. Kafka) vs reactive programming (RxJava, Project Reactor) plus improved protocols (RSocket)

We all agree that the usual request-response way of communicating microservices via HTTP calls leads to coupling between them. That took us to the event-driven approach in which services publish events that some other services will react to. For…
codependent
  • 23,193
  • 31
  • 166
  • 308
10
votes
4 answers

Microservices Saga pattern consumer awaits response

I would like to clarify what'd be the best way of organizing architecture. I've got rest api and microservices architecture. I have applied the Database per Service pattern. So let's imagine that the user wants to create an order(an e-commerce…
9
votes
5 answers

Python - How can I make this code asynchronous?

Here's some code that illustrates my problem: def blocking1(): while True: yield 'first blocking function example' def blocking2(): while True: yield 'second blocking function example' for i in blocking1(): print 'this…
dave
  • 7,717
  • 19
  • 68
  • 100
9
votes
3 answers

How to block thread to wait for response in vert.x?

I have a situation where I call an external API A and use its response to feed to request of API B and call it and afterwards return the response to caller of API A. Something like below method(){ response = call API A } …
tausif
  • 672
  • 1
  • 6
  • 15
9
votes
2 answers

Parallel dispatch of `groupBy` groups in Reactor

I'm learning Reactor, and I'm wondering how to achieve a certain behavior. Let's say I have a stream of incoming messages. Each message is associated with a certain entity and contains some data. interface Message { String getEntityId(); …
Viktor Dahl
  • 1,942
  • 3
  • 25
  • 36
8
votes
1 answer

Is tkwait wait_variable/wait_window/wait_visibility broken?

I recently started to use tkwait casually and noticed that some functionality only works under special conditions. For example: import tkinter as tk def w(seconds): dummy = tk.Toplevel(root) dummy.title(seconds) …
Thingamabobs
  • 7,274
  • 5
  • 21
  • 54
8
votes
2 answers

Microservice data replication patterns

In a microservice architecture, we usually have two ways for 2 microservices to communicate. Let’s say service A needs to get information from service B. The first option is a remote call, usually synchronous over HTTPS, so service A query an API…
8
votes
2 answers

API gateway for event-driven architecture

We're trying to split our monolithic core into microservices and add some new ones connected with each other using the message system (e.g. Kafka). The next stage is to create API endpoints for communication between mobile apps and microservices…
alexander
  • 81
  • 1
  • 6
8
votes
2 answers

Mediate and share data between different modules

I am just trying to get my head around event driven JS, so please bear with me. There are different kinds of modules within my app. Some just encapsulate data, others manage a part of the DOM. Some modules depend on others, sometimes one module…
Đinh Carabus
  • 3,403
  • 4
  • 22
  • 44
8
votes
1 answer

What a use case for Akka persistent actor?

I'm in mess about the applicability of Akka Persistence, and the persistent actors, when I should use a persistent Actor? Taking for example from a Cart module of a given Shopping Application, will be every user's Cart Session a persistent actor…
8
votes
5 answers

Stream reasoning / Reactive programming in prolog?

I was wondering if you know of any way to use prolog for stream processing, that is, some kind of reactive programming, or at least to let a query run on a knowledge base that is continuously updated (effectively a stream), and continuously output…
Samuel Lampa
  • 4,336
  • 5
  • 42
  • 63
8
votes
3 answers

What is Event Driven Concurrency?

I am starting to learn Scala and functional programming. I was reading the book !Programming scala: Tackle Multi-Core Complexity on the Java Virtual Machine". Upon the first chapter I've seen the word Event-Driven concurrency and Actor model. Before…
user962206
  • 15,637
  • 61
  • 177
  • 270
1 2
3
27 28