Reactor Pattern

Learn about the reactor pattern.

Introduction

The reactor pattern is generally used in I/O heavy applications. Let’s suppose we have an application that gets a lot of requests from the client.

Let’s assume that we have a situation where we have a thread that is listening to the client’s requests, processes the request, and sends back the response to the client. The problem is that the load on that specific thread increases significantly when there are too many requests. This can significantly delay other requests that then have to wait before getting processed.

According to the reactor pattern, there should be a main thread (reactor) ...