Professional Documents
Culture Documents
Java 9 Real - Time
Java 9 Real - Time
Java 9 Real - Time
In this article, we will discuss newly added Java 9 features. Oracle has released Open JDK 9 with
the several new features and improvements on July 27, 2017.
Java 9 is bringing lots of new enhancements which are going to affect your
programming style and habit, in big way. The biggest change is the modularization of
Java. It’s another big change after Lambdas in Java 8. In this article, I am listing down
changes which will be part of JDK 9 release.
JPMS (Java Platform Module System) is the core highlight of new Java 9 release. It is also
known as Project Jigshaw. A module is new construct like we already have packages. An
application, developed using new modular programming, can be seen as collection of
interacting modules with a well-defined boundaries and dependencies between those
modules.
The JPMS consists of providing support for writing modular applications as well as
modularizing the JDK source code as well. JDK 9 is coming with around 92 modules
(changes are possible in GA release). Java 9 Module System has a “java.base” Module.
It’s known as Base Module. It’s an Independent module and does NOT dependent on
any other modules. By default, all other modules are dependent on “java.base”.
In java modular programming-
1. A module is typically just a jar file that has a module-info.class file at the root.
2. To use a module, include the jar file into modulepath instead of the classpath. A
modular jar file added to classpath is normal jar file and module-info.class file will be
ignored.
exports com.howtodoinjava.demo;
module test {
requires helloworld;
Java 8 allowed you to write default methods in interfaces, and it was widely appreciated
feature. So after this, interfaces only lack few things and only non-private methods was
one of them. Java 9 onward, you are allowed to include private methods in interfaces.
These private methods will improve code re-usability inside interfaces. Foe example, if
two default methods needed to share code, a private interface method would allow
them to do so, but without exposing that private method to it’s implementing classes.
public interface CustomCalculator
{
default int addEvenNumbers(int... nums) {
}
default int addOddNumbers(int... nums) {
}
return IntStream.of(nums)
.filter(predicate)
.sum();
}
HTTP/2 Client
HTTP/1.1 client was released on 1997. A lot has changed since. So for Java 9 a new API
been introduced that is cleaner and clearer to use and which also adds support for
HTTP/2. New API uses 3 major classes i.e. HttpClient, HttpRequest and HttpResponse.
To make a request, it is as simple as getting your client, building a request and sending
it as shown below.
HttpClient httpClient = HttpClient.newHttpClient();
HttpRequest httpRequest =
HttpRequest.newBuilder().uri(newURI("//howtodoinjava.com/")).GET().build();
System.out.println( httpResponse.body() );
System.out.println(httpResponse.get().statusCode());
System.out.println(httpResponse.get().body());
} else {
httpResponse.cancel(true);
JShell is new command line interactive tool shipped with JDK 9 distribution [JEP 222] to
evaluate declarations, statements and expressions written in Java. JShell allows us to
execute Java code snippets and get immediate results without having to create a
solution or project.
Jshell is much like what we have command window in linux OS. Difference is that JShell
is Java specific. It has lots of other capabilities, other than executing simple code
snippets. e.g.
JDK 9 has improved logging in platform classes (JDK classes) and JVM components,
through a new loging API. It lets you specify a logging framework of your choice
(e.g. Log4J2) as logging backend for logging messages from JDK classes. There are few
things you should know about this API:
1. The API is meant to be used by the classes in the JDK, not by application classes.
2. For your application code, you will continue using other logging APIs as before.
3. The API does not let you configure the logger programmatically.
JDK 9 also added a new command-line option, -Xlog , that gives you a single point of
access to all messages logged from all classes of the JVM. The following is the syntax to
use the -Xlog option:
-Xlog[:][:[][:[][:]]]
All options are optional. If a preceding part in -Xlog is missing, you must use a colon for
that part. For example, -Xlog::stderr indicates that all parts are defaulted, output wich
is set as stderr.
Prior to Java 5, the only way to spawn a new process was to use
the Runtime.getRuntime().exec()method. Then in Java 5, ProcessBuilder API was
introduced which supported a cleaner way of spawning new processes. Now Java 9 is
adding a new way of getting information about current and any spawned process.
System.out.println( processHandle.getPid() );
System.out.println( processInfo.arguments().isPresent() );
System.out.println( pprocessInfo.command().isPresent() );
System.out.println( processInfo.command().get().contains("java") );
System.out.println( processInfo.startInstant().isPresent() );
To get the list of all child processes (direct as well as n-level deep),
use children() and descendants()method.
Stream<ProcessHandle> children = ProcessHandle.current().children();
Since Java 9, you can create immutable collections such as immutable list, immutable set
and immutable map using new factory methods. e.g.
import java.util.List;
public class ImmutableCollections
public static void main(String[] args)
{
List<String> namesList = List.of("Lokesh", "Amit", "John");
Set<String> namesSet = Set.of("Lokesh", "Amit", "John");
Map<String, String> namesMap = Map.ofEntries(
Map.entry("1", "Lokesh"),
Map.entry("2", "Amit"),
Map.entry("3", "Brian"));
}
This enhancement is related to how you package application classes in jar files.
Previously, you had to package all classes into a jar file and drop in the classpath of the
another application, which wish to use it.
Using multi-release feature, now a jar can contains different versions of a class –
compatible to different JDK releases. The information regarding different versions of a
class, and in which JDK version which class shall be picked up by class loaded, is stored
in MANIFEST.MF file. In this case, MANIFEST.MFfile includes the entry Multi-Release:
true in its main section.
Let’s assume that in JDK 10, A.class is updated to leverage some Java 10 features, then
this Jar file can be updated like this:
It looks really promising step to solve the dependency hell often seen in large
application where jars with different versions are not compatible with each other. This
feature can be a big help to tackle those scenarios.
Stack Walking
The stack is a Last-In-First-Out (LIFO) data structure. At JVM level, a stack stores frames.
A new frame is created and pushed to the top of the stack each time a method is
invoked. A frame is destroyed (popped out of stack) when the method invocation
completes. Each frame on a stack contains its own array of local variables, as well as its
own operand stack, return value, and reference to the runtime constant pool of the
current method’s class.
In a given thread, only one frame is active at any point. The active frame is known as the
current frame and its method is known as the current method . [Read More]
Till Java 8, StackTraceElement represents a stack frame. To get complete stack, you had
to use Thread.getStackTrace() and Throwable.getStackTrace(). It returned an array
of StackTraceElementwhich you can iterate to get required information.
In Java 9, a new class StackWalker has been introduced. The class provides easy and
efficient stack walking using sequential stream of stack frames for the current thread.
The StackWalker class is very efficient because it evaluates the stack frames lazily.
// Prints the details of all stack frames of the current thread
StackWalker.getInstance().forEach(System.out::println);
There are other lots of things you can do with this stream, which we will cover in some
other decdicated post.
Using HTML5 confers the benefits of the easier HTML5 structure. It also implements
the WAI-ARIA standard for accessibility. This aims to make it easier for people with
physical or visual impairments to access javadocs pages using tools such as screen
readers.
JEP 225 gives the ability to search a javadoc for program elements and tagged words
and phrases.
This is implemented client side, with a new search.js Javascript file, along with indexes
generated when the javadoc is generated. A search box is available on the generated
HTML5 API pages.
Please note that Search option will be added by default, but can be turned off with the
argument: -noindex.
Miscellaneous Other Features
There are other features as well in Java 9, which I am listing down here for quick
reference. We will discuss all these features in coming posts.
You can control the usage of this feature in your application using -XX:-
CompactStrings parameters to java command.
Prior to Java 9, string data was stored as an array of chars. This required 16 bits for each
char.
public final class String
private final char value[];
}
Starting with Java 9, strings are now internally represented using a byte array along with
a flag field for encoding references.
public final class String
/** The value is used for character storage. */
@Stable
private final byte[] value;
/**
*
* LATIN1
* UTF16
*
*/
private final byte coder;
}
-XX:-CompactStrings
Disables the Compact Strings feature. By default, this option is enabled. When this
option is enabled, Java Strings containing only single-byte characters are internally
represented and stored as single-byte-per-character Strings using ISO-8859-1 / Latin-1
encoding. This reduces, by 50%, the amount of space required for Strings containing
only single-byte characters. For Java Strings containing at least one multibyte character:
these are represented and stored as 2 bytes per character using UTF-16
encoding. Disabling the Compact Strings feature forces the use of UTF-16
encoding as the internal representation for all Java Strings.
Cases where it may be beneficial to disable Compact Strings include the following:
Java Modules
JPMS (Java Platform Module System) is the major enhancement in Java 9. It is also known
as Project Jigsaw. In this Java 9 modules example, we will learn about modules (in general) and
how your programming style will change in future when you will start writing modular code.
What is a Module in General
Strong Encapsulation
Encapsulation means to hide implementation details, which are are not essential to
know to use the module correctly. The purpose is that encapsulated code may
change freely without affecting users of the module.
Stable Abstraction
Abstraction helps to expose module functionality using interfaces i.e. public APIs.
Anytime, you want to change the business logic or implementation inside module
code, changes will be transparent to the module users.
Explicit dependencies
Modules can be dependent on other modules as well. These external
dependencies must be part of the module definition itself. These dependencies
between modules are often represented as graphs. Once you see the graph at
application level, you will have better understanding of the application’s
architecture.
Before java 9, you had ‘packages‘ to group related classes as per business capabilities.
Along with packages, you had ‘access modifiers‘ to control what will be visible and what
will be hidden to other classes or packages. It has been working great so far. Java has
strong support for encapsulation and abstraction.
But, explicit dependencies is where things start to fall apart. In java, dependencies are
declared with ‘import‘ statements; but they are strictly ‘compile time’ constructs. Once
code is compiled, there is no mechanism to clearly state it’s runtime dependencies. In
fact, java runtime dependency resolution is so much problematic area that special tools
have been created to fight this problem e.g. gradle or maven. Also, few frameworks
started bundling their complete runtime dependencies as well e.g. Spring bootprojects.
Java 9 Module System has a “java.base” Module. It’s known as Base Module. It’s an
Independent module and does NOT dependent on any other modules. By default, all other
modules dependent on “java.base”.
You will not feel any major difference between normal code and modular code if you
don’t know the specific things to look for. e.g.
1. A module is typically just a jar file that has a module-info.class file at the root.
2. To use a module, include the jar file into modulepath instead of the classpath. A
modular jar file added to classpath is normal jar file and module-info.class file will be
ignored.
After reading all above concepts, let’s see how modular code is written in reality. I am
using Netbeans IDE because it has good early support of Java 9 (as of today).
Create Java Modular Project
I have added two modules helloworld and test. Let’s see their code and project
structure.
module helloworld {
}
HelloWorldApp.java
package com.howtodoinjava.demo;
public class HelloWorldApp {
public static void sayHello() {
}
/test/module-info.java
module test {
TestApp.java
package com.test;
public class TestApp {
public static void main(String[] args) {
//some code
}
exports com.howtodoinjava.demo;
}
module test {
requires helloworld;
package com.test;
import com.howtodoinjava.demo.HelloWorldApp;
public class TestApp {
public static void main(String[] args) {
HelloWorldApp.sayHello();
}
Output:
Hello from HelloWorldApp
Launching JShell
The very first thing is to have JDK 9 installed into your machine. Download JDK 9 from
this link, and install it.
Now launch a new command window and check the java version.
>> java -version
Now again launch new command prompt window and type command jshell. It will
change the cursor to jshell.
Jshell Launched Window
Jshell allow to create small code snippets and test them without requiring to create and
build a complex project. And that’s how it should be used. Working on JShell is kept
easy to make it usable and fast. Let’s see how?
Variables
You can define variables just like you do in real programming. Only difference is that
you don’t have to write a class or main method to start with.
jshell> int i = 10;
i ==> 10
To print the value of variable, just type the variable name and hit ENTER. It will print
the value of variable.
jshell> i
i ==> 10
i ==> 20
| int i = 20
| int j = 30
Wo
rking with Variables in JShell
Methods
To create method in jshell, define method with retrun type, method name, parameters
and method body. Access modifiers are not required.
jshell> int sum (int a, int b) {
...> return a+b;
...> }
| int sum(int,int)
$6 ==> 4
If you want to view the method code, use /list command. It will show the current
method sourcecode. T
jshell> /list sum
1 : int sum (int a, int b) {
return a+b;
}
To change the method code, you will need to rewrite the new modified code, with same
method name.
jshell> int sum (int a, int b) {
...> int c = a+b;
...> return c;
...> }
jshell> /list sum
3 : int sum (int a, int b) {
int c = a+b;
return c;
}
Working with Methods in JShell
Please keep in mind the method overloading rules. It you changed the method parameters
count or their data types, then it will be a new method and there will be two methods registered
in jshell.
By the time, you are working in few lines of code, JShell inline editor is good enough.
But when you code start getting bigger then you might need a file editor to modify your
code.
Here you can use JShell edit pad. To launch edit pad, use /edit command with method
name.
JShell Edit Pad
Here change the method code as you want and click on Accept button. Modified code
will be updated in Jshell and you will get confirmation message in prompt. You can
change code as many time times as you like, save it and then exit the window.
Edit pad is really good enough for most of the needs, still if you like to code on any
particular editor then you can use it as well. JShell allows to easily configure any external
editor to edit the code snippets. You just need to get the complete path to the editor
we want to use and run /set editorcommand in JShell to configure the editor.
/set editor "C:\\Program Files\\Sublime Text 3\\sublime_text.exe"
Now execute the /edit command again. Now it will open the code in sublime editor.
Feel free to edit the code and save you did in edit pad.
Many times, you will have some code already written in any java file and you would like
to execute it into JShell. To load file in JShell, use /open command.
int i1 = 10;
int i2 = 20;
int i3 = 30;
int i4 = 40;
int sum(int a, int b) {
return a+b;
int sum(int a, int b, int c) {
return a+b;
That’s all you must know while working with JShell REPL tool in Java 9.
Java Stream of Dates with
LocalDate.datesUntil()
Date/Time handling always been a pain area for java developers. The new Date-Time API
added in Java 8 changed the way, you interact with dates in java. It was a very powerful
and much needed improvement. The only thing missing was, getting a stream of dates
having some common difference between two subsequent dates (though it was possible
but there was no easy way).
Syntax of LocalDate.datesUntil()
The first version (i.e. without a Period) internally calls the second method
with Period.ofDays(1) and generates stream of dates with difference of 1 day in
between.
import java.time.LocalDate;
import java.time.Period;
import java.util.List;
import java.util.stream.Collectors;
public class Java9StreamExamples {
public static void main(String[] args) {
System.out.println( getDaysInJava9(LocalDate.now(),
LocalDate.now().plusDays(10)) );
System.out.println( getDaysInJava9Weeks(LocalDate.now(),
LocalDate.now().plusWeeks(10)) );
}
return start.datesUntil(end).collect(Collectors.toList());
}
return start.datesUntil(end, Period.ofWeeks(1)).collect(Collectors.toList());
}
Output:
[2017-07-31, 2017-08-01, 2017-08-02, 2017-08-03, 2017-08-04,
2017-08-05, 2017-08-06, 2017-08-07, 2017-08-08, 2017-08-09]
[2017-07-31, 2017-08-07, 2017-08-14, 2017-08-21, 2017-08-28,
2017-09-04, 2017-09-11, 2017-09-18, 2017-09-25, 2017-10-02]
Date Stream in Java 8
If you have still not adapted Java 9, then you can use given below method method to
generate Date streams. This code is compatible to Java 8.
import java.time.LocalDate;
import java.time.Period;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Java9StreamExamples {
public static void main(String[] args)
{
System.out.println( getDaysInJava8(LocalDate.now(), 10) );
}
//Stream of dates with 1 day difference
{
.limit(days)
.collect(Collectors.toList());
}
Output:
[2017-07-31, 2017-08-01, 2017-08-02, 2017-08-03, 2017-08-04,
2017-08-05, 2017-08-06, 2017-08-07, 2017-08-08, 2017-08-09]
Java 9 Stream API Improvements
In this example, we have list of chars from ‘a’ to ‘i’. I want all chars which may appear
before char ‘d’ in iteration.
List<String> alphabets = List.of("a", "b", "c", "d", "e", "f", "g", "h", "i");
List<String> subset1 = alphabets
.stream()
.collect(Collectors.toList());
System.out.println(subset1);
Output:
[a, b, c]
List<String> subset2 = alphabets
.stream()
.collect(Collectors.toList());
System.out.println(subset2);
Output:
[d, e, f, g, h, i]
iterate() methods used for creating a stream which starts with a single element (the
seed), and subsequent elements are produced by successively applying the unary
operator. The result is an infinite stream. To terminate the stream, a limit or some other
short-circuiting function, like findFirstor findAny is used.
.limit(10)
.collect(Collectors.toList());
System.out.println(numbers);
Output:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
.collect(Collectors.toList());
System.out.println(numbers);
Output:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
In above examples, the first stream is the Java 8 way of using iterate with a limit. The
second one uses a Predicate as the second argument.
New Stream ofNullable() method
System.out.println(stream.count());
stream = Stream.ofNullable(null);
System.out.println(stream.count());
Output:
1
static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
//varargs
package com.howtodoinjava;
import java.util.List;
public class ImmutableCollections
public static void main(String[] args)
{
System.out.println(names);
//java.lang.NullPointerException
}
Output:
[Lokesh, Amit, John]
1. Set do not allow duplicate elements as well. Any duplicate element passed will result
in IllegalArgumentException.
2. The iteration order of set elements is unspecified and is subject to change.
static <E> Set<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
static <E> Set<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
static <E> Set<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
static <E> Set<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
//varargs
import java.util.Set;
public class ImmutableCollections {
public static void main(String[] args) {
System.out.println(names);
//java.lang.NullPointerException
//java.lang.IllegalArgumentException
}
...
...
Java 9 also provide a special method for creating Map entry instance.
import java.util.Map;
public class ImmutableCollections {
public static void main(String[] args) {
Map.entry("1", "Lokesh"),
Map.entry("2", "Amit"),
Map.entry("3", "Brian"));
System.out.println(names);
//UnsupportedOperationException
//names.put("2", "Ravi");
}
Output:
{1=Lokesh, 2=Amit, 3=Brian}
Java 9 onward, you are allowed to include private methods in interfaces. Using private
methods, now encapsulation is possible in interfaces as well.
In Java 7 and all earlier versions, interfaces were very simple. They could only
contain public abstractmethods. These interface methods MUST be implemented by
classes which choose to implement the interface.
public interface CustomInterface {
public abstract void method();
public class CustomClass implements CustomInterface {
@Override
public void method() {
System.out.println("Hello World");
}
public static void main(String[] args){
instance.method();
}
Output:
Hello World
public interface CustomInterface {
public abstract void method1();
public default void method2() {
System.out.println("default method");
}
public static void method3() {
System.out.println("static method");
}
public class CustomClass implements CustomInterface {
@Override
public void method1() {
System.out.println("abstract method");
}
public static void main(String[] args){
instance.method1();
instance.method2();
CustomInterface.method3();
}
Output:
abstract method
default method
static method
Access modifier ‘public’ is optional in all above interface method declarations. I have added
them to improve readability only.
These private methods will improve code re-usability inside interfaces. Foe example, if
two default methods needed to share code, a private interface method would allow
them to do so, but without exposing that private method to it’s implementing classes.
public interface CustomInterface {
public abstract void method1();
public default void method2() {
System.out.println("default method");
}
public static void method3() {
System.out.println("static method");
}
private void method4(){
System.out.println("private method");
}
private static void method5(){
}
public class CustomClass implements CustomInterface {
@Override
public void method1() {
System.out.println("abstract method");
}
public static void main(String[] args){
instance.method1();
instance.method2();
CustomInterface.method3();
}
Output:
abstract method
private method
private static method
default method
private static method
static method
I am creating a calculator class with two functions. First function will accept some
integers and add all even numbers in it. Second function will accept some integers and
add all odd numbers in it.
CustomCalculator.java – Interface
import java.util.function.IntPredicate;
import java.util.stream.IntStream;
public interface CustomCalculator
default int addEvenNumbers(int... nums) {
}
default int addOddNumbers(int... nums) {
return add(n -> n % 2 != 0, nums);
}
return IntStream.of(nums)
.filter(predicate)
.sum();
}
Main.java – Class
public class Main implements CustomCalculator {
public static void main(String[] args) {
int sumOfEvens = demo.addEvenNumbers(1,2,3,4,5,6,7,8,9);
System.out.println(sumOfEvens);
int sumOfOdds = demo.addOddNumbers(1,2,3,4,5,6,7,8,9);
System.out.println(sumOfOdds);
}
Output:
20
25
Summary
private Java 9
G:\>jshell
| Welcome to JShell -- Version 9-ea
| For an introduction type: /help intro
jshell> int a = 10
a ==> 10
In Java SE 8 and earlier versions, We can use Collections class utility methods
like unmodifiableXXX to create Immutable Collection objects. For instance, if we
want to create an Immutable List, then we can use Collections.unmodifiableList
met,hod.
List and Set interfaces have “of()” methods to create an empty or no-empty
Immutable List or Set objects as shown below:
Empty List Example
To avoid redundant code and more re-usability, Oracle Corp is going to introduce
private methods in Java SE 9 Interfaces. From Java SE 9 on-wards, we can write
private and private static methods too in an interface using ‘private’ keyword.
These private methods are like other class private methods only, there is no
difference between them.
}
If you want to read more about this new feature, please go through this link: Java
9 Private methods in Interface.
o Modular JDK
o Modular Java Source Code
o Modular Run-time Images
o Encapsulate Java Internal APIs
o Java Platform Module System
JDK 9 is coming with 92 modules (may change in final release). We can use JDK
Modules and also we can create our own modules as shown below:
module com.foo.bar { }
Here We are using ‘module’ to create a simple module. Each module has a name,
related code and other resources.
To read more details about this new architecture and hands-on experience, please
go through my original tutorials here:
o java.lang.ProcessHandle
o java.lang.ProcessHandle.Info
Java SE 7 example
To read more about this feature, please go through my original tutorial at: Java SE
9: CompletableFuture API Improvements
Reactive Streams
Now-a-days, Reactive Programming has become very popular in developing
applications to get some beautiful benefits. Scala, Play, Akka etc. Frameworks
has already integrated Reactive Streams and getting many benefits. Oracle Corps
is also introducing new Reactive Streams API in Java SE 9.
Java SE 9 has introduced the following API to develop Reactive Streams in Java-
based applications.
o java.util.concurrent.Flow
o java.util.concurrent.Flow.Publisher
o java.util.concurrent.Flow.Subscriber
o java.util.concurrent.Flow.Processor
Read more at Java 9 Reactive Streams.
If a value present in the given Optional object, this stream() method returns a
sequential Stream with that value. Otherwise, it returns an Empty Stream.
They have added “stream()” method to work on Optional objects lazily as shown
below:
To understand more about this feature with more examples and to read more new
methods added to Optional class, please go through my original tutorial at: Java
SE 9: Optional Class Improvements
Stream API Improvements
In Java SE 9, Oracle Corp has added four useful new methods to java.util.Stream
interface. As Stream is an interface, all those new implemented methods are
default methods. Two of them are very important: dropWhile and takeWhile
methods
If you are familiar with Scala Language or any Functions programming language,
you will definitely know about these methods. These are very useful methods in
writing some functional style code. Let us discuss about takeWhile utility method
here.
HTTP 2 Client
In Java SE 9, Oracle Corp is going to release New HTTP 2 Client API to support
HTTP/2 protocol and WebSocket features. As existing or Legacy HTTP Client API
has numerous issues (like supports HTTP/1.1 protocol and does not support
HTTP/2 protocol and WebSocket, works only in Blocking mode and lot of
performance issues.), they are replacing this HttpURLConnection API with new
HTTP client.
They are going to introduce new HTTP 2 Client API under “java.net.http” package.
It supports both HTTP/1.1 and HTTP/2 protocols. It supports both Synchronous
(Blocking Mode) and Asynchronous Modes. It supports Asynchronous Mode using
WebSocket API.
As of now, I did not get enough information about these features. That’s why I am
going list them here for brief understanding. I will pickup these Features one by
one and add to above section with a brief discussion and example. And final write
a separate tutorial later.