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
WARNING: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
91
-
92
-
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
CreateConnectionResponse res = sdk.connections().createConnection()
@@ -134,8 +114,120 @@ public class Application {
134
114
}
135
115
}
136
116
```
117
+
#### Asynchronous Call
118
+
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] -->
166
+
## Asynchronous Support
167
+
168
+
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.
169
+
170
+
<details>
171
+
<summary>Why Use Async?</summary>
172
+
173
+
Asynchronous operations provide several key benefits:
174
+
175
+
-**Non-blocking I/O**: Your threads stay free for other work while operations are in flight
176
+
-**Better resource utilization**: Handle more concurrent operations with fewer threads
177
+
-**Improved scalability**: Build highly responsive applications that can handle thousands of concurrent requests
178
+
-**Reactive integration**: Works seamlessly with reactive streams and backpressure handling
179
+
180
+
</details>
181
+
182
+
<details>
183
+
<summary>Reactive Library Integration</summary>
184
+
185
+
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.
186
+
187
+
**Why Reactive Streams over JDK Flow?**
188
+
-**Broader ecosystem compatibility**: Most reactive libraries (Project Reactor, RxJava, Akka Streams, etc.) natively support Reactive Streams
189
+
-**Industry standard**: Reactive Streams is the de facto standard for reactive programming in Java
190
+
-**Better interoperability**: Seamless integration without additional adapters for most use cases
191
+
192
+
**Integration with Popular Libraries:**
193
+
-**Project Reactor**: Use `Flux.from(publisher)` to convert to Reactor types
194
+
-**RxJava**: Use `Flowable.fromPublisher(publisher)` for RxJava integration
195
+
-**Akka Streams**: Use `Source.fromPublisher(publisher)` for Akka Streams integration
196
+
-**Vert.x**: Use `ReadStream.fromPublisher(vertx, publisher)` for Vert.x reactive streams
197
+
-**Mutiny**: Use `Multi.createFrom().publisher(publisher)` for Quarkus Mutiny integration
198
+
199
+
**For JDK Flow API Integration:**
200
+
If you need JDK Flow API compatibility (e.g., for Quarkus/Mutiny 2), you can use adapters:
201
+
```java
202
+
// Convert Reactive Streams Publisher to Flow Publisher
*[createOrUpdateOrganizationOAuthCredentials](docs/sdks/organizations/README.md#createorupdateorganizationoauthcredentials) - Create OAuth override credentials for an organization and source type.
245
339
*[listOrganizationsForUser](docs/sdks/organizations/README.md#listorganizationsforuser) - List all organizations for a user
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
520
+
521
+
__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
522
+
523
+
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
524
+
<!-- End Debugging [debug] -->
525
+
399
526
<!-- Placeholder for Future Speakeasy SDK Sections -->
0 commit comments