Wire java.net.http send/sendAsync to the socket layer - #4
Merged
Conversation
The HttpClient shim covered construction; now send/sendAsync actually perform the request over the same connect/build-request/parse-response machinery clj-http-lite uses. send is synchronous; sendAsync runs the request and returns an already-settled future whose thenApply/exceptionally apply immediately — enough for the cognitect aws-api backend, which does (.sendAsync client req handler) then .thenApply/.exceptionally. The request builder now captures the body publisher, and BodyHandlers.ofString/ofByteArray pick the response body type. conn-ex / throw-typed now build their typed throwable via jolt.host/throwable instead of a hand-rolled :jolt/ex-info table, so .getMessage / ex-message work (the aws backend reads .getMessage) alongside (class e) / instance?. clj-http-lite suite stays green (60/116); the aws java backend now makes real requests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #3 (the construction shim).
send/sendAsyncnow perform the request over the same socket/TLS machinery clj-http-lite uses, so the cognitect aws-api java backend makes real requests:(.sendAsync client req handler)→.thenApply/.exceptionallydeliver{:status :body :headers}to the channel. sendAsync returns an already-settled future (the request runs synchronously). The request builder captures the body publisher; BodyHandlers.ofString/ofByteArray select the response body type.conn-ex/throw-typed now build their typed throwable via
jolt.host/throwable(a new jolt seam) so.getMessage/ex-messagework alongside(class e)/instance?— the aws backend reads.getMessage.clj-http-lite suite stays green (60/116). Needs jolt with the
jolt.host/throwableseam (jolt PR #245).