Description
clientcore
at this time is synchronous APIs only, which differs from what has historically been provided by azure-core
which has built-in support for Reactor. For the time being our plan is to have clientcore
remain synchronous and expect for consumers of the library to wrap our synchronous calls with their own asynchronous handling. Even though we won't give formal support, we should do investigations into what strategies for asynchronous handling would work best.
A few solutions for asynchronous calls are:
- Thread management using
ExecutorService
, and similar concepts built into the base language. - Using an external library such as Reactor and using their Schedulers to allow for blocking calls throughout their asynchronous flow.
- Wrapping our synchronous calls with Future (which is a slightly different take on the first point).
Given our aim to limit external dependencies used by clientcore
we should spend the most time on what is available within the JDK itself. And should also do some investigations into Java 21 virtual threads, which isn't exactly the same as asynchronous but is somewhat related.
Longer term vision, we may want to look at how our recommended pattern will interact with external libraries such as Reactor which can use CompletableFuture's as a supplier for a Mono / Flux.