Reactive Programming in Java: How, Why, and Is It Worth Doing? Data flow
Reactive Programming in Java: How, Why, and Is It Worth Doing? Data flow
Data flow and reactive programming. Check it out.
21 Jun 2021
788
Other articles
How to incrementally migrate the data from RDBMS to Hadoop using Sqoop Incremental Last Modified technique?
How to implement Slowly Changing Dimensions(SCD) Type 2 in Spark?
How to incrementally migrate the data from RDBMS to Hadoop using Sqoop Incremental Append technique?
Why MongoDB don't fetch all the matching documents for the query fired
How to solve the issue of full disk utilization in HDFS Namenode
Can We Use HDFS as Back-up Storage?
How to do Indexing in MongoDB with Elastic Search? Part 1
How to do Indexing in MongoDB with Elastic Search? Part 2
How to store data on browser using NoSQL IndexedDB?
How to Apply MBTI in HR: Motivation for every day. Groups of People & their Motivations
Data Flow
A standard application job is to read, process, and write data. If we want to make these operations asynchronous, we should use asynchronous reading, processing, and writing.
For example, if an asynchronous function is blocked, we write excellent code:
readData.get() and blocked,
processData.get() and blocked,
writeData.get() and blocked immediately.
And we get synchronous code at the output. It’s not asynchronous and not easy to use.
Let’s look at a typical task where we have asynchronous data reading and then want to process data in three threads:
We don't need many threads to wait for the results of the reading. We just want to get data. This data should be processed, and processing is a resource-consuming task in terms of CPU, and it would be good to parallelize it. We say: “Read data. Once you do it, process them in three threads, then combine the results of execution and write data.” And we would like to do this as asynchronous operations.
The original article can be found here.
Interested in learning how to program with Java or in upgrading your Java programming skills? Check out our trainings.