Zip operator in reactive programming
Today we will see, how to use Zip operator in reactive programming. It is useful when writing microservices. Sometimes, we need to fetch some data from a group of services. Then, we wait for the requests to complete. Finally, we process the results. Making requests one by one would be very inefficient. However, Zip operator […]
Immutable classes in Java and Kotlin
If we write code that runs on more than one thread, sooner or later we meet the idea of immutable classes. The lack of ‘write’ functions makes them very useful in multi-threaded applications. In this article I’m going to show what immutable classes are in Java and Kotlin. We will also look at the practical […]
Backpressure in reactive streams: a closer look
The backpressure is an important property of reactive streams. In simple words, it ensures us that the publishers do not produce new elements faster than we can process them. In this way, we avoid overloading our system. Over years, I noticed that many newcomers to the reactive world have trouble with understanding how backpressure affects […]
Creating batches with Project Reactor
Imagine an event processing service that consumes application events from a queue. It works well until one day, when it starts lagging. Events are processed with large delays, and the queues fill up. What happens? Most likely we experience a sudden spike of events and our service is not able to catch up. In this […]
Barriers in LMAX Disruptor
LMAX Disruptor is a high performance inter-thread messaging library for Java. When the first version appeared several years ago, it made a lot of buzz on the Internet thanks to the innovative approach to concurrency. This article focuses on event consumers and barriers in LMAX Disruptor. Barriers are an important part of Disruptor architecture. They […]