From ac6d172a1c67d97e45ffbfa9dcf051ccaa5df5ba Mon Sep 17 00:00:00 2001 From: David Griffin Date: Fri, 20 Sep 2024 09:40:47 -0700 Subject: [PATCH] Reorder some methods. --- src/main/java/com/fauna/client/FaunaClient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/fauna/client/FaunaClient.java b/src/main/java/com/fauna/client/FaunaClient.java index 40a86c5c..22b7423a 100644 --- a/src/main/java/com/fauna/client/FaunaClient.java +++ b/src/main/java/com/fauna/client/FaunaClient.java @@ -51,10 +51,6 @@ public Optional getLastTransactionTs() { return ts > 0 ? Optional.of(ts) : Optional.empty(); } - private Supplier>> makeAsyncRequest(HttpClient client, HttpRequest request, Codec codec) { - return () -> client.sendAsync(request, HttpResponse.BodyHandlers.ofInputStream()).thenApply(body -> QueryResponse.parseResponse(body, codec)).whenComplete(this::completeRequest); - } - private static Optional extractServiceException(Throwable throwable) { if (throwable.getCause() instanceof ServiceException) { return Optional.of((ServiceException) throwable.getCause()); @@ -78,6 +74,11 @@ private void completeRequest(QuerySuccess success, Throwable throwable) { } } + private Supplier>> makeAsyncRequest(HttpClient client, HttpRequest request, Codec codec) { + return () -> client.sendAsync(request, HttpResponse.BodyHandlers.ofInputStream()).thenApply(body -> QueryResponse.parseResponse(body, codec)).whenComplete(this::completeRequest); + } + + //region Asynchronous API /** * Sends an asynchronous Fauna Query Language (FQL) query to Fauna.