Future is the class in JDK that gives ability to get result somehow in the future.
During the interval application can perform another task that how parallelism can give immediate benefit without deep refactoring of application.
Here is the example of GET operation with future:
GkvsFuture<Record>future=Gkvs.Client.get(KEY).async();// do something elseRecordrecord=future.getUnchecked();// blocking code
And MULTI_GET example:
GkvsFuture<Iterable<Record>>records=Gkvs.Client.multiGet(LOAD_KEYS).async();// do something elsefor(Recordrec:records.getUnchecked()){System.out.println(rec.key().get());}
GkvsFuture also supports classical get() function with all checked exceptions in the list.
Additionally GkvsFuture has ability to register a listener and get notification when data will be available.