Reactive Programming has the edge

Reactive Programming is now taking the world by Storm. Previously we would building the application in a sequential manner. We would wait for the update from each of the service calls and proceed to next statement on execution.

Reactive Programming gives the edge by not waiting for the output from the service and moves to the next line of execution.

The lazy evaluation of the functional programming can be very well used by the Reactive programming.Initially it provides the handle for processing from the server side.

The data is passed between the client and server is in the form of data-stream.This uses the streaming capability for passing on the data and retrieving the update at a later point of time. One of the

Initially it was done before as

public String downloadContents(URL url) throws IOException { try(InputStream input = url.openStream()) { return IOUtils.toString(input, StandardCharsets.UTF_8); } } //... final String contents = downloadContents(new URL("http://www.example.com")); In the Reactive Programming

public static Future<String> startDownloading(URL url) { //... } final Future<String> contentsFuture = startDownloading(new URL("http://www.example.com")); //other computation final String contents = contentsFuture.get();

We will implement startDownloading() later. For now it's important that you understand the principles.startDownloading() does not block, waiting for external website. Instead it returns immediately, returning a lightweight Future<String> object. This acts like a proxy of wrapper for getting the data. Once the asynchronous process is over it returns the data.

To view or add a comment, sign in

More articles by Prasad Narasimhan

  • Designing with Angular JS 6.

    Initially when creating a component in Angular JS lets take care of the following better design. Component : Consists…

  • Event Driven Computing with AWS

    Microservices are often deployed into independent servers they don't share any compute or Storage resources. You should…

  • Kubernates,Messos and Docker

    Google designed Kubernetes from scratch to orchestrate Docker containers. Kubernetes was released in February 2015 with…

  • Restful in AWS

    This days lot many APIs are hosted on the Cloud Mobile,Web,Enterprise,IOT , Analytics on Cloud. We will look at AWS as…

  • Enterprise Transformation roadmap

    In the Previous article we happened to look at what is enterprise Transformation, How the Data Consolidation handles…

  • Enterprise Transformation

    Enterprise Transformation is a term which has been there for long. There are several approaches such as Zachman, Togaf…

  • Serverless approach using Amazon Lambda

    Serverless approach is the new trend where we want to expose the Data as a Service which can be consumed by any…

    2 Comments
  • Digital platforms

    Usage of Camel in implementing EAI approach As we were discussing on many of the EAI patterns Pipes and Filters is one…

  • Digital platforms

    Discussing about the Landscape of Digital Platform how its transforming the industry In previous articles we happen to…

  • Digital Transformations

    In continuation with the article on Digital Transformation I happened to talk about fusion of technologies coming…

Explore content categories