What are the differences between event-driven and thread-based server system?

The difference might be described as follows (with some simplification): in “thread driven” runtimes, when a request comes in, a new thread is created and all the handling is done in that thread. in “event driven” runtimes, when a request comes in, the event is dispatched and handler will pick it up. When? In Node.js, … Read more

What is SEDA (Staged Event Driven Architecture)?

Thread Architecture vs Staged Event-Drive Architecture in real life: Imagine you have a restaurant. Now, how it will work? with “Thread Architecture”: A customer arrives Waiter(a) goes to him/her Waiter(a) takes him/her to one available table Waiter(a) takes the order Waiter(a) cooks the order Waiter(a) takes to order to the table Waiter(a) waits until the … Read more

What’s the difference between event-driven and asynchronous? Between epoll and AIO?

Events is one of the paradigms to achieve asynchronous execution. But not all asynchronous systems use events. That is about semantic meaning of these two – one is super-entity of another. epoll and aio use different metaphors: epoll is a blocking operation (epoll_wait()) – you block the thread until some event happens and then you … Read more

onclick event function in JavaScript

Two observations: You should write <input type=”button” value=”button text” /> instead of <input type=”button”>button text</input> You should rename your function. The function click() is already defined on a button (it simulates a click), and gets a higher priority then your method. Note that there are a couple of suggestions here that are plain wrong, and … Read more

How is reactive programming different than event-driven programming?

How is reactive programming different than event-driven programming? Event driven programming revolves around so-called events, which are abstract things that programs “fire” when something happens. Other places in your code “listen” for the events and respond with what they need to do when that event happens. For instance, an event could be “user pressed this … Read more

What so different about Node.js’s event-driven? Can’t we do that in ASP.Net’s HttpAsyncHandler?

First of all, Node.js is not multi-threaded. This is important. You have to be a very talented programmer to design programs that work perfectly in a threaded environment. Threads are just hard. You have to be a god to maintain a threaded project where it wasn’t designed properly. There are just so many problems that … Read more