-
Improvement
-
Resolution: Unresolved
-
None
-
unspecified
-
None
-
Operating System: All
Platform: All
With the availability of JDK8, more libraries are available that make functional asynchronous programming feasible. Asynchronous data store access performed in sfc-genius module is a proof of concept of it. It would be good to extend the concept to the sfc-provider API so than an asynchronous API is available project wide.
An initial approach could be:
New module
sfc-util/sfc-datastore-utils
that will hold general asynchronous access utilities that could be
used to access not only sfc data store but also other data stores. For
example, we could move there the following utility classes/methods from
sfc-genius:
- SfcGenius::toCompletableFuture
Converts to google guava ListenableFuture to the standard JDK8
CompletableFuture
- SfcGeniusAbstractReader::doRead
Handles absence of optional as an Exception
- SfcGeniusAbstractReader::doReadOptional
Converts google guava Optional to standard JDK8 optional
Then we could start working on a parallel asynchronous API on the
sfc-provider module i.e. "async-api". As we enrich that API, the sync
API can be refactored to wrap the async-api converting it to synchronous.