You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An asynchronous SDK client is also available that returns a [`CompletableFuture<T>`][comp-fut]. See [Asynchronous Support](#asynchronous-support) for more details on async benefits and reactive library integration.
<!-- Start Asynchronous Support [async-support] -->
233
+
## Asynchronous Support
234
+
235
+
The SDK provides comprehensive asynchronous support using Java's [`CompletableFuture<T>`][comp-fut] and [Reactive Streams `Publisher<T>`][reactive-streams] APIs. This design makes no assumptions about your choice of reactive toolkit, allowing seamless integration with any reactive library.
236
+
237
+
<details>
238
+
<summary>Why Use Async?</summary>
239
+
240
+
Asynchronous operations provide several key benefits:
241
+
242
+
-**Non-blocking I/O**: Your threads stay free for other work while operations are in flight
243
+
-**Better resource utilization**: Handle more concurrent operations with fewer threads
244
+
-**Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests
245
+
-**Reactive integration**: Works seamlessly with reactive streams and backpressure handling
246
+
247
+
</details>
248
+
249
+
<details>
250
+
<summary>Reactive Library Integration</summary>
251
+
252
+
The SDK returns [Reactive Streams `Publisher<T>`][reactive-streams] instances for operations dealing with streams involving multiple I/O interactions. We use Reactive Streams instead of JDK Flow API to provide broader compatibility with the reactive ecosystem, as most reactive libraries natively support Reactive Streams.
253
+
254
+
**Why Reactive Streams over JDK Flow?**
255
+
-**Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
256
+
-**Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java
257
+
-**Better interoperability**: Seamless integration without additional adapters for most use cases
258
+
259
+
**Integration with Popular Libraries:**
260
+
-**Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types
261
+
-**RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration
262
+
-**Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration
263
+
-**Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams
264
+
-**Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration
265
+
266
+
**For JDK Flow API Integration:**
267
+
If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
268
+
```java
269
+
// Convert Reactive Streams Publisher to Flow Publisher
0 commit comments